-
Notifications
You must be signed in to change notification settings - Fork 192
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
Deleting a default key for helmrelease (setting to null) #372
Comments
I guess this is what |
@stefanprodan I've just tested by running kustomize build locally - it produces the value with null correctly and as I've mentioned it works as expected when the resource is created the first time. The problem occurs only on update. Actually, I've just tested this manually by executing kubectl apply in the same order (result is the same), so this is related to kubectl and how it applies the change... |
I don't see how we could do something about this, we exec to run |
|
Should this be moved to Helm Controller? I'm not sure it is a Kustomize Controller issue. |
I think that this is indeed not a kustomize controller issue and not even a fluxcd issue, but if there are any ideas on the solution then can be moved to helm controller for sure. In any case the good workaround is to just move the values to configmap and reference it via valuesFrom. |
I noticed that unsetting a default chart value does now work when using
A regular The doc says the following:
Does it mean that Flux does not handle this special |
I'm reproducing the same problem with https://github.com/crossplane/crossplane/blob/969b8ebdf2aedc1849302b687f2eebeba94b55f3/cluster/charts/crossplane/values.yaml.tmpl#L65-L69 whose value.yml has
A strategic patch with the following
when trying to set a null runAsUser in the value gets ignored, and results into the HelmRelease value field as
As a result the default chart values are assigned by flux helm release
Trying to assign an empty map {} in the value, simply gets ignored by the strategic merge. My workaround is to use helm post rendered to correct incorrect helm values in the resulting helm rendered templates, but this breaks the helm chart encapsulation. |
I ran into the same issue as @gberche-orange, with a very similar usecase. I noticed that when using flux as intended via git and using a kustomization, it does indeed delete the null value, but when applying an hr directly using kubectl apply, the null values are not deleted and helm install works as intended with the deletion of the default keys. |
Seems like it is a kustomize issue, not sure if there is much flux can do about it: kubernetes-sigs/kustomize#4628 |
I see this was fixed in Kustomize 5.x, but since Flux is still using the 4.x version the bug is still present. |
The upgrade to Kustomize 5 includes permanent and final deprecation of https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.0.0 This should hopefully become normalized for the Flux 2.0.0 final release, I think it hasn't made it into any release candidate yet. It looks like these changes should harmonize to settle on It's not clear from the release notes if Kustomize 5 is landing in 2.0.0, or if it may land yet in the next |
Kustomize 5.x is planned before landing v2.0.0. Hopes this answers (part) of the question. |
Is it already not upgraded in v1.0.0 according to the changelog https://github.com/fluxcd/kustomize-controller/blob/v1.0.0/CHANGELOG.md? |
Yes, Kustomize v5 has been introduced to Flux since Flux 2.0.0 and Kustomize Controller 1.0.0, and we're up to Kustomize 5.2 as of Flux 2.2 (which comes with some more breaking fixes) This issue should be resolved, if I understood the thread correctly reviewing it just now in summary? (Can anyone confirm to close it?) |
@kingdonb, it doesn't seem fixed to me, I'm still experiencing this issue on HelmRelease upgrades with these versions: › flux version
flux: v2.2.3
distribution: flux-v2.2.3
helm-controller: v0.37.4
kustomize-controller: v1.2.2
notification-controller: v1.2.4
source-controller: v1.2.4 |
same here |
Is this still the case? |
Helm supports unsetting/deleting the default chart value: https://helm.sh/docs/chart_template_guide/values_files/#deleting-a-default-key
It works as expected when you set some value to null when HelmRelease is created the first time, for example you set cpu limit to null and the end result is:
but if you update the HelmRelease and set some other value to null, for example memory limit, it ends up as:
Thus, it doesn't propagate to helm and has no effect at all. I hope this bug is not inherent to the kubectl/k8s itself and can be fixed in kustomize-controller.
The text was updated successfully, but these errors were encountered: