Reputation: 35460
Suppose that I have a Deployment which loads the env variables from a ConfigMap:
spec.template.spec.containers[].envFrom.configMapRef
Now suppose that I change the data inside the ConfigMap.
When exactly are the Pod env variables updated? (i.e. when the app running in a pod sees the new env variables)
For example (note that we are inside a Deployment):
Upvotes: 0
Views: 1183
Reputation: 8200
When using a ConfigMap with env variables, the values are not updated. You have to restart the pod.
If you want hot reload, you can mount that ConfigMap as a volume. Then values are updated automatically, however the app has still to watch for that change.
Upvotes: 0
Reputation: 35460
After some testing (with v1.20) I see that env variables in Pod template are updated immediately (it's just a reference to external values).
However the container does not see the new env variables... You need at least to restart it (or otherwise delete and recreate the pod).
Upvotes: 1