Skip to content
kubernetes

The Helm Value Change That Never Reached the Pod

·7 min read

You change an image digest in a HelmRelease. The release reconciles, reports UpgradeSucceeded, and the revision number moves. The pods keep the old image.

You restart the pods. They come back on the old image. You bump the values again. Nothing. At this point the instinct is that Flux is stuck, or Helm is lying, or the registry is serving a stale tag. All three are wrong, and the real cause is more mundane: two controllers own the same field, and the other one is winning.

Why this happens

A Flux Kustomization applies a hand-written manifest over the same resources. People call it a bridge or an overlay. It exists because something needed a manual fix once: an OOM limit, a hotfix hold, an env value the chart did not expose. It also sets the fields you are now trying to change, and it carries the annotation:

metadata:
  annotations:
    kustomize.toolkit.fluxcd.io/ssa: Merge

Merge means “apply my fields and leave the rest”. So the kustomize controller re-asserts the old digest on its own interval, and Helm’s change is reverted within seconds to minutes. Both controllers are doing exactly what they were told.

Find the second owner in four steps

1. Confirm the release rendered your value. Do not trust the status. Decode the release secret:

kubectl -n <ns> get secret sh.helm.release.v1.<release>.v<N> -o jsonpath='{.data.release}' \
  | base64 -d | base64 -d | gunzip | grep -n 'sha256:'

If your digest is in there, Helm did its job and the problem is downstream.

2. Read the effective image from the live object, never from the values file:

kubectl -n <ns> get deploy -o custom-columns=NAME:.metadata.name,IMAGE:.spec.template.spec.containers[0].image --no-headers

3. Find the owning Kustomization from the Deployment’s labels:

kubectl -n <ns> get deploy <name> -o jsonpath='{.metadata.labels}'; echo
kubectl get kustomizations -A | grep <app>

The label kustomize.toolkit.fluxcd.io/name names the controller that owns the field.

4. Grep that Kustomization’s path in Git for the old value:

git grep -l '<old-digest>' <revision> -- <path>

Read the file header when you find it. Bridges usually document why they exist, and some say “do not resume Helm”. That comment is an instruction from whoever built it, not background prose.

Placeholders are yours to fill: <release>, <ns>, <app>, <bridge-file> and <app-dir>. The Python snippet further down illustrates an assertion and is not a runnable script. BRIDGES, METRICS, old_b and old_w stand for your own paths and digests.

Fix the bridge, not the release

Change the value in the bridge file, keep its resources and unrelated settings untouched, and record why in the header comment. Land it through the normal pull request flow. Flux reconciles from Git, so the change takes effect with no Helm action at all.

What not to do:

  • Do not kubectl set env or kubectl edit the live Deployment. The controller reverts it on its next pass, and you will have learned nothing.
  • Do not commit a value bump “to force a fresh revision so the images roll”. Helm already rendered the new digest. A bump changes the revision number and still loses to the bridge. That commit is proof the bridge owns the field, not a fix.

The expensive version is partial

The failure above is loud, because everything stays old. The expensive version is quiet: the bridge pins every image in the app by hand, you bump the HelmRelease digests, and you update the bridge only where the digest you grepped for happened to appear. The API rolls forward and the workers do not. The app now runs two versions against one database.

The damage does not look like an error. It looks like a job that reports success and does nothing. The new API accepts the request, enqueues it, the old worker executes it on code that has no idea the feature exists, and it writes completed with a null result. Counts look plausible. Status is green. The work never happened.

So treat the images as one family:

grep -n 'sha256:' <bridge-file>

Read the name: next to every hit, not only the one you are changing. A build produces a digest per image, and the API, worker, media worker and cron images all move together.

Then bump with a script that asserts an expected count per file before it writes anything:

plan = [(BRIDGES, {"backend": 1, "worker": 3}), (METRICS, {"backend": 1})]
for path, expected in plan:
    found = {"backend": text.count(old_b), "worker": text.count(old_w)}
    assert found == expected, f"{path.name}: expected {expected}, found {found}"

A partial write is worse than no write. The assertion also tells you about a file you did not know was pinning the image, which is how I found the second overlay.

Verify per Deployment afterwards, and never with rollout status alone. A Deployment whose spec did not change is already rolled out and reports success while running the old digest.

Two more places the same thing hides

A spec.values block inside the HelmRelease itself. It beats the chart values file silently, and it is easy to miss because it lives in the same file as the pin and reads like ordinary configuration. You edit values-production.yaml, the release upgrades, the pods keep the old tag. Grep the GitOps repo for the component name, not for the value you changed, and read the effective image from the live object.

A blocked Kustomization that reads as success. If the Kustomization that owns the app is False on a dependency it does not control, Flux applies nothing from that path. The in-cluster HelmRelease keeps its old spec.values, the pods keep the old image, and the release still shows a fresh revision from a retry that rendered the same unchanged values, with Helm upgrade succeeded in its Ready message.

Three facts settle it, and you need all three:

kubectl -n flux-system get kustomization <app> \
  -o jsonpath='{.status.conditions[?(@.type=="Ready")].message}{"\n"}{.status.lastAppliedRevision}{"\n"}'
kubectl -n <ns> get helmrelease <release> -o jsonpath='{.spec.values.image.backendDigest}{"\n"}'
kubectl -n <ns> get deploy <deploy> -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'

If lastAppliedRevision is not your commit, nothing downstream can have your change. Read the dependency message, confirm the dependency is healthy now, and let it reconcile. A stale False clears on its own. When the named dependency is already healthy and the blocked Kustomization still will not move, force the whole tree rather than nudging the app alone.

The order of questions

When a pin appears not to roll, ask in this order:

  1. What does the Kustomization say, including its build errors and lastAppliedRevision?
  2. What does the app’s GitRepository say its commit is?
  3. What does the HelmRelease say its values are?
  4. What image is each Deployment actually running?

The pods are the last place the answer appears, and the first place people look.

If the wider question is whether the cluster is worth running at this size, answer that before you debug its deploy path: Kubernetes for SaaS startups: do you actually need it?.

One habit prevents most of this. Validate the directory before you push a pin:

cd <gitops-repo>/apps/<cluster>/<app> && kubectl kustomize . > /dev/null && echo OK

It parses the manifests locally, it costs a second, and it catches the case where a comment you added above a value line left the digest at column zero. That breaks the mapping, nothing in the path applies, and the release still looks healthy while your change sits unapplied.

Retire the bridge, do not just edit it

Editing the bridge unblocks today and leaves the hazard in place. The release path is now a chart bump, plus a digest pin, plus a bridge edit in however many files, and the bridge wins silently. Anyone reading only the HelmRelease will draw the wrong conclusion about what is deployed.

Plan the retirement as its own reviewed change: fold the bridge’s owned values back into the HelmRelease, lift any hold in a reviewed window, confirm the chart renders the same pods the bridge produced, then delete the bridge manifests. Do not bundle it with a feature deploy. It changes who owns production fields, so it needs its own rollback.

Related Articles

Want a second read on your setup?

Paste one Dockerfile, Compose file, or CI pipeline. We read it and send back one page: the three biggest risks and the first fix. Written by an engineer, not a bot.

Get the free triage