flux2
flux2 copied to clipboard
Need the ability to disable HelmRelease upgrades when a configmap value is changed
Describe the bug
We are using HelmRelease with a valuesFrom field using a ConfigMap. We have a need where we do not want to trigger a HelmRelease on ConfigMap change, but only HelmRelease itself is updated.
Steps to reproduce
- Create a HelmChart with a strict JSON schema.
- Update the chart so it adds a new value to the schema.
- Push the updated value to the ConfigMap
- Upgrade the HelmRelease Chart version
The ConfigMap upgrade will trigger a HelmRelease before the Chart is updated, but the strict json schema to fail the release, then the HelmRelease will trigger an upgrade and it will succeed.
We have a need to only trigger it once without failure.
Expected behavior
The ConfigMap upgrade should not trigger a HelmRelease, then the HelmRelease will trigger an upgrade and it will succeed.
Screenshots and recordings
No response
OS / Distro
N/A
Flux version
N/A
Flux check
N/A
Git provider
No response
Container Registry provider
No response
Additional context
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Are you using a GitRepository source for your helm release?
This has some quirks, if that's the case then you should try setting the reconcileStrategy
in spec.chart.spec
to Revision
, as HelmChart resources are considered to be immutable by version, the Helm Controller will not reconcile a new HelmChart until it sees the chart version has been updated:
https://fluxcd.io/docs/components/helm/api/#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate
Edit: Sorry, I think I may have misinterpreted your question...
No problem. Also we are unfortunately not using GitRepository either.
https://fluxcd.io/docs/guides/helmreleases/#refer-to-values-in-configmaps-generated-with-kustomize (maybe related)
Is this the relationship between your configmap and helmrelease, or something else?
If the configmap is a source in valuesFrom
then a change to the configmap represents a change to the inputs, which will trigger HelmRelease to upgrade on the next reconcile.
There are three things AIUI which Helm Controller checks for updates on each reconcile, that finding any in an altered state will result in an upgrade operation: valuesFrom
inputs, the HelmRelease
in the spec itself, and the Helm Chart (which effectively only changes when the HelmRepository publishes a new revision.)
It's not clear enough what you're trying to accomplish without examples from your own manifests. Without more information we are not likely to be able to help you resolve this. Could you post the helmrelease and configmap?
(I'm interested in what you are doing with JSON Schema, I've never seen it used together with Helm although I know it's supported!)
I will mock up an example for you tomorrow, sorry I can't get to it this weekend. The JSON schema is just the easiest way to break it, you don't need it to achieve the issue (happy to do it that way though if you are looking for an example). Will get back to you.
Helm Controller checks for updates on each reconcile, that finding any in an altered state will result in an upgrade operation: valuesFrom inputs
Exactly, my ask is for the ability to disable this specific case. We would like to update from the HelmRelease spec only (an annotation flag to disable seems appropriate).