-
Notifications
You must be signed in to change notification settings - Fork 8
feat: API for custom helm chart configuration #1015
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
Conversation
| name: <CLUSTER_NAME>-helm-addons-config | ||
| namespace: <CLUSTER_NAMESPACE> | ||
| labels: | ||
| clusterctl.cluster.x-k8s.io/move: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this label is strictly needed. According to the Move documentation, object with either clusterctl.cluster.x-k8s.io/move: "" or direct/indirect ownerReference will be moved.
I am not sure if ownerReference is not explicitly added, it will be added indirectly when the configmap is referenced by the Cluster object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ownerRef won't be added automatically, but I think the controller in CAREN should add it.
This is similar to what CAREN does with CCM/CSI Secrets and adds an ownerRef.
Then when all clusters that own are deleted the Secret (CM in this case) would be garbageCollected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
is CAREN mutating webhook is the right place to the owner reference?
45524ed to
c395876
Compare
manoj-nutanix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also define generic struct for addon config like -
type AddonConfig struct {
ChartName string `json:"chartName,omitempty"`
ChartVersion string `json:"chartVersion,omitempty"`
RepositoryURL string `json:"repositoryURL,omitempty"`
}
Users can define above field in cluster spec and konvoy can use these values and generate ConfigMap for the same.
api/v1alpha1/addon_types.go
Outdated
|
|
||
| type GenericAddons struct { | ||
| // +kubebuilder:validation:Optional | ||
| HelmChartConfig *HelmChartConfig `json:"helmChartConfig,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we should description for this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially commented on this in the design doc and seeing it in code I'm still not sure about this field being part of the GenericAddons struct, which is inlined in Docker/AWS/NutanixAddons structs, that also have other addons structs (CSI/COSI) that would inherit this configuration.
I really think we should consider a higher level API for configuration, maybe something like:
addonsConfiguration:
helm: # ie HelmAddon strategy
configMapRef:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me start a thread on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to making this field a sibling of the addons field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing the two fields, I wouldn't understand which one is for addon configuration:
addons:
cni:
addonsConfiguration:
configMapRef:
Can we find another name for addonsConfiguration, something that communicates that it's a list of sources for all addons (even one's we're not enabling for the cluster).
Maybe addonsSources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can represent multiple strategies (helm, CRS, etc) in the configmap itself, then we can avoid the helm field.
So, instead of
addonsConfiguration:
helm:
configMapRef:
We have
addonsConfiguration:
configMapRef:
And we put all sources, for all strategies, in this one ConfigMap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If addonsSources limits us too much, maybe addonsMetadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the feedback and inputs. I like addonsMetadata and top level field suggestion. I will update the PR with what we discussed.
Initially we wanted to keep the API simple and ensure that the Chart versions that shipped with current version are compatible with helm values shipped with it and use sane defaults in the We can revisit above suggestion in wake of upgrade usecase. I love to hear other opinions. |
| addon-name: | | ||
| ChartName: addon-chart-name | ||
| ChartVersion: 1.0.0 | ||
| RepositoryURL: https://my-chart-repository.example.com/charts/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can enforce this format somehow without needing to jump to a whole CRD 🤔
just a thought i wanted to note down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we discussed:
- The new CRD would look like HelmChartProxy and CAREN's job would be take data from this new CRD and set it in HelmChartProxy.
- We want to keep using default configuration
default-helm-chart-configto make it easy for customers to not worry about chart retrival details and making mistakes. - CRD will be additional API on top of CAREN API which we think might not worth to maintain or overkill at this moment.
We decided to have a structured types instead of map of string values in the configmap and expose it though Go external library for GO clients. We can document the type schema for the API client.
I will create a follow up documentation and PR to demo this.
@manoj-nutanix We discuss above design in huddle (Sorry could not talk with you due to timezone difference, I can discuss outcome with you on Monday PST). |
437e52b to
ad5da85
Compare
|
We recently added changes to upgrade/update cluster with new cluster class to force reconcile. We will leverage this mechanism instead of creating new API variable. Closing this PR. |
What problem does this PR solve?:
API to support custom helm chart configuration for addons
The addons can be installed and upgraded only during
AfterControlPlaneInitializationorBeforeClusterUpgradehook.If an addon needs to upgraded without upgrading kubernetes cluster, the cluster object has to be modified so that it could trigger reconciliation of addons.
A separate controller will manage the upgrade of addons outside kubernetes upgrade. Check draft PR #740
Custom helm chart configuration allows to upgrade addons without kubernetes version upgrade.
The API clients can create custom ConfigMap including some or all addons configuration and update the Cluster variable
clusterConfig.addons.helmChartConfig.configMapRef.namewith the name of the local ConfigMap.To install addons using custom helm configuration, specify following values:
The format of the custom configmap
Which issue(s) this PR fixes:
Fixes #
How Has This Been Tested?:
Special notes for your reviewer:
Lets finalize API in this PR. I plan to maintain
feature/addon-upgradebranch until next release and create all related changes as stack PRs.