-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document CustomResources ownership #117
Comments
Hey @gianlucam76 I would like to work on this issue. |
@hanshal101 thank you so much. The repository used for documentation is sveltos We use mkdocs behind the scene. So once you fork/clone repo locally, if you have mkdocs installed, "mkdocs serve" will allow you see change locally |
Gotcha |
New section sounds good. Thank you |
Ok Thanks for the swift response |
Heyy @gianlucam76 I have made this diagram according to my understanding related to this issue. Please guide me for all the changes that is to be made for this diagram. Thank You. |
Thank you @hanshal101 !!! You are correct, ClusterProfile owns ClusterSummary. ClusterProfile.Spec.ClusterSelector contains a Kubernetes label selector used by Sveltos to decide on which clusters to deploy add-ons (helm charts, raw YAML, etc) listed in the ClusterProfile instance. For every cluster matching a ClusterProfile, a ClusterSummary is created:
apiVersion: config.projectsveltos.io/v1alpha1
kind: ClusterSummary
metadata:
...
labels:
projectsveltos.io/cluster-name: clusterapi-workload
projectsveltos.io/cluster-profile-name: kyverno
projectsveltos.io/cluster-type: Capi
name: kyverno-capi-clusterapi-workload
namespace: default
ownerReferences:
- apiVersion: config.projectsveltos.io/v1alpha1
kind: ClusterProfile
name: kyverno
uid: ae1812f8-f36d-4006-b8fc-da3c3deb380b ClusterSummary.Spec.ClusterProfileSpec contains all the add-ons to be deployed clusterProfileSpec:
helmCharts:
- chartName: kyverno/kyverno
chartVersion: v3.0.1
helmChartAction: Install
releaseName: kyverno-latest
releaseNamespace: kyverno
repositoryName: kyverno
repositoryURL: https://kyverno.github.io/kyverno/
values: |
admissionController:
replicas: 1 ClusterSummary.Status.FeatureSummaries contains the status (whether add-ons are deployed or being deployed or any error occurred) status:
dependencies: no dependencies
featureSummaries:
- featureID: Helm
hash: VFvzbvlAg91J3Fp7q2hD1yHPwGaSuyD7JPEC6AuKT3E=
lastAppliedTime: "2023-12-27T13:00:44Z"
status: Provisioned Also Sveltos has another CustomResourceDefinition, called ClusterConfiguration. There is one ClusterConfiguration for each managed Cluster. apiVersion: config.projectsveltos.io/v1alpha1
kind: ClusterConfiguration
metadata:
labels:
projectsveltos.io/cluster-name: clusterapi-workload
projectsveltos.io/cluster-type: Capi
name: capi--clusterapi-workload
namespace: default
ownerReferences:
- apiVersion: config.projectsveltos.io/v1alpha1
kind: ClusterProfile
name: kyverno
uid: ae1812f8-f36d-4006-b8fc-da3c3deb380b
- apiVersion: config.projectsveltos.io/v1alpha1
kind: ClusterProfile
name: nginx
uid: 904412bd-92a8-4a66-bf98-581ad32dcb61 ClusterConfiguration.Status.ClusterProfileResources contains all resources deployed by Sveltos on that cluster (considering all matching ClusterProfile instances) status:
clusterProfileResources:
- Features:
- charts:
- appVersion: v1.10.0
chartVersion: 3.0.1
lastAppliedTime: "2023-12-27T13:00:16Z"
namespace: kyverno
releaseName: kyverno-latest
repoURL: https://kyverno.github.io/kyverno/
featureID: Helm
profileName: kyverno
- Features:
- charts:
- appVersion: 2.3.0
chartVersion: 0.14.0
lastAppliedTime: "2023-12-27T13:11:16Z"
namespace: nginx
releaseName: nginx-latest
repoURL: https://helm.nginx.com/stable/
featureID: Helm
profileName: nginx |
Oh ok |
Thank you @hanshal101 I think your diagram is good. I would:
Then create one similar for ClusterConfiguration. But that's just my 2 cents. Your call. |
Sorry for the late response, @gianlucam76 |
Hi @hanshal101, thank you. In your diagram, you already have that a ClusterProfile owns a ClusterSummary.
Then add two Clusters, each with
Then show the ClusterProfile owns two ClusterSummary (one per matching managed cluster). Also, instead of listing properties of the ClusterProfile, I suggest we list properties of the ClusterSummary and specifically the addons and applications to be deployed and their status. Then (it can also be done separately) we do same for ClusterConfiguration. Essentially since we have two managed clusters, there will be two ClusterConfigurations. And we add that any ClusterProfile matching a managed cluster is added as OwnerReference of the corresponding ClusterConfiguration. So if again there are two clusters with labels
we can have two ClusterProfiles both with
and then have two ClusterConfigurations (one for each cluster). The two ClusterProfiles both own both the ClusterConfigurations. |
Oh, ok |
Do we have any Slack channels or any other community messaging servers to interact with other developers and contributers? |
Thank you so much @hanshal101 Yes we do have a slack channel |
Thank you @gianlucam76 |
sent you an invitation to join. thank you |
ok |
User Story
As a developer I would like comprehensive documentation for the CRs ownership relationship. For instance, when a cluster matches a ClusterProfile, a ClusterSummary is created and it is owned by the ClusterProfile instance.
This comes in particularly handy as the number of CRDs of the project keeps growing.
Detailed Description
In order to make it easier for devs to quickly understand sveltos internals, in the documentation (https://projectsveltos.github.io/sveltos/) create a section with some CRs ownership diagram.
Add information on when CRs are created/update/deleted and which other CR owns it.
/kind documentation
/help
/good-first-issue
The text was updated successfully, but these errors were encountered: