-
Notifications
You must be signed in to change notification settings - Fork 47
Description
User Story
As an operator I would like to specify helm values from external configmap or secret resources, in order to be able to support installing a chart on multiple clusters, with the option to override values on each cluster.
Detailed Description
Currently, HelmChartProxySpec specifies a valuesTemplate
field (
cluster-api-addon-provider-helm/api/v1alpha1/helmchartproxy_types.go
Lines 74 to 77 in dad0b2c
// ValuesTemplate is an inline YAML representing the values for the Helm chart. This YAML supports Go templating to reference | |
// fields from each selected workload Cluster and programatically create and set values. | |
// +optional | |
ValuesTemplate string `json:"valuesTemplate,omitempty"` |
To accomodate this, the API could be extended to accept a valuesTemplatesFrom
field, with the following spec:
type HelmChartValuesFrom struct {
// Kind is ConfigMap or Secret.
//
// +kubebuilder:validation:Enum:=ConfigMap;Secret
Kind string `json:"kind"`
// Name is the name of the ConfigMap resource.
// It supports Go templating to reference fields from each selected workload Cluster and programatically compute the name of the resource.
Name string `json:"name"`
// Namespace is the namespace of the ConfigMap resource.
// It supports Go templating to reference fields from each selected workload Cluster and programatically compute the namespace of the resource.
Namespace string `json:"namespace"`
// Key is the data key to use from the ConfigMap resource.
// It supports Go templating to reference fields from each selected workload Cluster and programatically compute the data key.
Key string `json:"key"`
// Required indicates that the references resource and key must exist, otherwise applying the chart will fail.
// +optional
Required bool `json:"required,omitempty"`
// Priority indicates the priority of this values object. High priority takes precedence. Values from ValuesTemplate will be applied with priority 1, so
// the default zero value means that values from ValuesTemplatesFrom are applied after.
// +optional
Priority int `json:"priority,omitempty"`
}
required
allows ignoring missing keys (e.g. if no overrides are specified, simply ignore)priority
allows setting priority on the different values templatesname
,namespace
andkey
can also be templated based on the Cluster object. We could include information about the helm release itself.
Anything else you would like to add:
An alternative approach would be to mantain separate almost identical HelmChartProxy objects per application per cluster, but that can quickly become harder to manage.
We would be very interested to implement this feature, we are opening this issue to gather some initial feedback and see if CAAPH finds this interesting or useful to have.
We would also be willing to adjust the scope of this, according to feedback from CAAPH maintainers (e.g. adjusting the supported fields).
/kind feature