k3s-io/helm-controller

Add a Values structured field

gbonnefille opened this issue · 3 comments

Currently, in order to pass values to HelmChart or HelmChartConfig, we have to use the ValuesContent field. This field is a string, generally used as a block:

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: myapp
  namespace: kube-system
spec:
  valuesContent: |-
    ingress:
      enabled: true

Having a Values structured field would be much more usefull as we will be able to play with kustomize to patch subparts of this field in overlays.

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: myapp
  namespace: kube-system
spec:
  values:
    ingress:
      enabled: true

ProjectHelmCharts supports this with a construct called a GenericMap https://github.com/aiyengar2/helm-project-operator/blob/3032ca2bb64964f96bb446657d246826ce78a670/pkg/apis/helm.cattle.io/v1alpha1/project.go#L20, which also implements toYaml.

If k3s-io/helm-controller wants to introduce this feature, I could move it over the rancher/wrangler as a generic type that can be used to define this field. Should be a straightforward feature request.

Could also look into using *apiextensionsv1.JSON the way that fluxcd does as well.