run-as-daemon.dev
← Writing
kubernetes / debugging

Your image edits don’t show up because a ConfigMap is shadowing them

2026-07-20 · ~4 min

You rebuilt the image, pushed it, rolled the deployment — and the old behaviour is still there. Before you blame the registry cache, check what’s mounted over your files.

The trap

A deployment mounts a dozen files from ConfigMaps straight over paths inside the container — hotpatches that once made sense. Now every image rebuild is invisible for those paths, because the mount wins over the image layer at runtime. You can rebuild forever; the running file is the ConfigMap’s.

How to catch it fast

The fix

Patch the source of truth, not the image:

kubectl create cm app-cfg --from-file=./file \
  --dry-run=client -o yaml | kubectl replace -f -
kubectl rollout restart deploy/app
“The registry is caching my image” is the wrong diagnosis nine times out of ten. The right one is boring: something is mounted over your file.

Longer term, retire the shadow-mounts back into the image once the hotpatch has proven itself — config drift you can’t see is config drift that will burn the next person.

Keeping infrastructure alive under real conditions is the day job. If your business can’t afford the guessing — turnkey delivery, one accountable owner: ftops.space.