Search code examples
kuberneteskubernetes-helmconfigmap

Does helm upgrade on a configmap automatically inject new data into running pod?


When issuing a helm upgrade on a running pod, my configmap is updated, but will the pod know about the configmap updated values automatically or is there another step that I need to take to inject new configmap values into the pod?

My overall goal is to avoid having to interact with the running pod such as a delete or restart / reinstall.

I've seen a lot of info about changing sha1sum and doing some workarounds, but my question is more basic - do pods automatically become aware of new configmap items?

---- UPDATE --- so what we ended up doing was:

helm upgrade -n release -f release/values.yaml **--recreate-pods**  

although this terminates the existing pod, another one is instantly started upon issuing the command, meaning "near zero" downtime.


Solution

  • No, pods do not automatically become aware of the contents of a config map change.

    In the case of a helm upgrade, that’s why you need to use helm template syntax to add the config map file’s hash value to the pod (or pod template) metadata. This creates a link between the config and pod.

    If you do that, the pod (or pod template) is updated even if only the config map is changed. Then, no manual intervention is required.