-
Notifications
You must be signed in to change notification settings - Fork 174
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
Helm ValuesFiles not updated during reconciliation #328
Comments
Btw I understand that the version number needs to be changed when the chart itself changes, but not when the values are updated. It does indeed make sense that the chart itself is locked with the version number (we typically don't really bump it internally when we make a change, since we're used to a monorepo where "latest" is always the only version. But we could sort that out I guess). |
The values you're referring to are really part of the chart, which is evidenced by the fact that when you set The chart versioning covers both the template and default values, so similarly changing a file in the In case it helps, you can also use the content of a configmap as the whole https://fluxcd.io/docs/components/helm/helmreleases/#values-overrides If you follow the first example and leave
... then it's assumed the values you want to merge in are a map containing all of the values to merge from the configmap, The other thing to know is that while Helm Controller subscribes to the HelmRelease for updates, there is no subscription to the ConfigMap as far as I know, so you will have to make sure if your HelmRelease is set to a long reconcile This |
Thanks for the input! Yeah my CI pipeline could output a ConfigMap that gets picked up by flux and referenced as a The big thing that I'm really trying to achieve is the ability to use the helm command line tools along flux for debuggability. If I could locally use To exemplify: if I run the helm chart locally, with for instance If I could just point out my Is there some "Flux"y way to deal with that kind of scenario? How do people usually deal with debuggability and predictability with flux? I'm pretty new here so sorry if I overlooked something obvious. |
That's a good point and that's definitely a known gap in our usability. I think I heard it said that we would have a replacement for In the mean time you can extract the values from your configmap and render them in the helm client like this:
I used
volumes:
- - emptyDir: {}
- name: plugins
- - configMap:
+ - name: plugins
+ emptyDir: {}
+ - name: jenkins-config
+ configMap:
name: jenkins
- name: jenkins-config That seems to be a problem in Helm Diff (and thanks for pointing at that, I wasn't aware of this plugin) – I see it complaining about some things that will be removed, I don't know if it's because of configmap generators or another issue. I also see a bundle of labels that I know Flux uses for accounting, that is missing because Helm Template won't emit them, and so it reflects in the diff of every resource. This is hard to read and not an ideal suggestion to solve this problem for users. Suffice it to say that while this diff problem may be in the works to solve soon with Flux Kustomizations thanks to advances in Kustomize controller, I am afraid it will be a while longer before it can be solved in Helm Controller, if it even can be solved at all. The semantics of the 3-way merge in Helm added together with things like configmap generators and postRender instructions make some diffs very hard to reason about. It is on the order of twice as difficult to answer this question for Helm. |
Yeah I also noticed that It should be noted that AFAIK For instance if your k8s resource uses a list with
Then sometimes it seems like the helm controller will instead apply something like
Or vice versa. So yeah, the helm controller altering the source text is a bit unfortunate. I'm not sure why this happens, but it seems like it's loaded into some internal format and normalized (via Kustomize perhaps?), which causes the applied helm release to differ from the rendered text. If you would prefer, that could be a separate github issue (or perhaps something that the As I said, there might be some Flux'y way to handle diffing, but it seems like if we want to support the typical
|
FYI I made this issue about the diffing: databus23/helm-diff#310 |
We would have better luck if we could feed both versions through a YAML linting/sorting function before comparing them. I'm afraid it probably isn't Helm Controller that has munged up the YAML, but the cluster's etcd data store which likely does not treat maps as ordered data structures. Also possible I'm wrong and Helm Controller actually did munge the data up before writing it into the helm revision secret, (and say that's by design maybe) so either way the effect is we get these unordered data structures back out with some key values in a different order than what Helm template had originally put into the cluster. If this is truly a divergence from how Helm upstream behaves, and it impacts how Helm diff can be used I would generally tend to think of that kind of thing as a bug in Helm Controller, but I would almost rather consider it a bug in Moreover I think there's a chance it would be solved rapidly on the |
I generally wouldn't expect any YAML that gets fed into the cluster and read back out to preserve their original formatting. It's interesting that |
The latest source- and helm-controller releases offer support for defining a |
That sounds really promising @hiddeco ! I guess we can close this one out. Any ideas when its coming into a flux release? |
This is available with |
Originally posted as fluxcd/flux#3556
Thanks for a great piece of software! I'm having a blast with it.
This issue is not to report on a bug with the runtime implementation, but with the semantics of HelmRelease CRDs.
I have a HelmRelease where I load the values from normal helm value files. According to https://fluxcd.io/docs/components/helm/helmreleases/ the way to do that is to put them in the Spec, like so:
This works perfectly file, loading in the values.yaml file and adding values_prod_tag.yaml on top. But it doesn't update the helm release on reconciliation if either of the values files are changed. Reconciliation will only pick up the changes if I bump the "version" number on the chart.
The reason why I'm using normal helm values.yaml-files instead a
ConfigMap
orSecret
definition is twofold:Updating a values file referenced by a HelmRelease should re-render the helm chart and update the installed helm release upon reconciliation.
What I'm looking for is probably what was referred to as
valuesFrom: chartFileRef
in the Helm Operator: https://fluxcd.io/docs/migration/helm-operator-migration/#chart-file-references are there any plans to implement this for the Helm Controller? It would be awesome to be able to ship values into the rendering from a normal helm values file, rather than aConfigMap
orSecret
definition fileAlternatively, if there is some other more "Flux"-y way I would be very interested to learn!
➜ ~ flux check
► checking prerequisites
✔ kubectl 1.22.0 >=1.18.0-0
✔ Kubernetes 1.20.9 >=1.16.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.11.2
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.14.1
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.16.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.15.4
✔ all checks passed
The text was updated successfully, but these errors were encountered: