A ConfigMap was updated but the pod still shows old values. Why?
IntermediateScenarioConfiguration, Secrets and storage
Answer
Situation read → The change was applied but the app behaves as before.
What I'd do →
- Check how it is consumed: env vars are fixed at container start
- For mounted files wait for the kubelet sync (up to about a minute) and check with
kubectl exec -- cat /etc/app/config - Check whether
subPathis used, which never updates - Check the app reloads files, since many only read at startup
- Trigger
kubectl rollout restartor use a config checksum annotation
Why → Kubernetes updates the projected files, but it cannot make a process re-read them.
Interview tip → Say Reloader or a checksum annotation makes it automatic.
More on Configuration, Secrets and storage
How do you inject configuration into pods and what are the options?BeginnerHow do you store a database password safely in Kubernetes?BeginnerHow do you manage secrets in GitOps without committing them in plain text?IntermediateA pod fails with `CreateContainerConfigError` and a missing key. What happened?BeginnerWhat is the difference between emptyDir, hostPath, PV/PVC and when do you use each?BeginnerA StatefulSet's PVC stays Pending. How do you debug?Intermediate