helm-controller
helm-controller copied to clipboard
HelmChartConfig deletion is not tracked
It appears the controller is currently silently ignoring the deletion of HelmChartConfig resource. It seems the the controller should track those, and redeploy (upgrade?) the corresponding Helm release to reflect the new desired state. Since the controller does track updates, a workaround is to update the deployed HelmChartConfig resource to one with "empty" values. But properly tracking deletions would be better, as it would match the intuitive expectations / principle of least surprise.
Isn't this a duplicate of https://github.com/k3s-io/helm-controller/issues/33 ?
@SchoolGuy: No, it is not. #33 is not very precise about exactly what deletion is failing, but it is most likely about deletion of Helm releases via deletion of HelmChart resource. This one is about removing the customization / extra values via deletion of HelmChartConfig resource - and keeping / redeploying the release.
I am using k3s-v1.21.4+k3s1. Also running into this issue. Adding a HelmChartConfig results in my k8s resources getting updated, but nothing happens when deleting it.
Taking traefik as an example.
The following things would happen when I add a HelmChartConfig
- A
Configmapin which all the Helm Values are stored is updated. The new values is appended into theConfigmap. (It ischart-values-traefikin my example) - The helm-install
Job(which ishelm-install-traefikin my example) is re-created. The helm-install is re-run against the updatedConfigmap. - My k8s resources are updated expectedly.
When deleting the HelmChartConfig, nothing happens
- The
Configmapis not updated - The
Jobis not re-created - Nothing gets updated
I can confirm this report. Just ran into this because I changed the traefik log level to debug. After fixing my problem I removed the HelmChartConfig again.
My expectation was the traefik would be upgraded with the old log level. Instead it kept running at log level debug.
Hello, I had the problem today, and maybe I can add more info: I wanted to move the content of the HelmChartConfig CRD to the "valuesContent" field of the HelmChart CRD, while doing some modification to the config. So I deleted the HelmChartConfig CRD and updated the HelmChart CRD with a "valuesContent" field.
When I applied my modifications, the helm job did run, but the old values of the deleted HelmChartConfig were still used instead of the new ones from the HelmChart.
The problem comes from the "chart-values-xxx" secret which still contains the "values-10_HelmChartConfig.yaml" data, which contains the values from the deleted HelmChartConfig. These values take precedence over the "values-01_HelmChart.yaml" that exists in the same secret.
To workround the problem, I deleted the secret before removing the HelmChartConfig CRD
The ValuesSecret contents are regenerated every time the HelmChart or HelmChartConfig resource are modified: https://github.com/k3s-io/helm-controller/blob/2f32059d43e626be840b7021c2c8028790f53c1f/pkg/controllers/chart/chart.go#L590-L618
If the HelmChartConfig is deleted, the relevant section will be absent from the generated secret. I don't see any way that the values-10_HelmChartConfig.yaml would continue to be present if the source for that content is gone.