-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: API for custom helm chart configuration #1015
base: main
Are you sure you want to change the base?
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
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.
@@ -86,6 +86,9 @@ type NutanixAddons struct { | |||
} | |||
|
|||
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.
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. |
What problem does this PR solve?:
API to support custom helm chart configuration for addons
The addons can be installed and upgraded only during
AfterControlPlaneInitialization
orBeforeClusterUpgrade
hook.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.name
with 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-upgrade
branch until next release and create all related changes as stack PRs.