<p>i have a sample nodejs application which uses an envVar environment variable, i have deployed this on kubernetes cluster. I am passing the env variable through config map.</p>

<p>once deployed and when pods is all running, if i change my config map with new value. Should deployment of my nodejs application need to be redone after this?</p>

<p>configmap.yaml</p>

<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: app1-config
  namespace: default
data:
  envVal: '12345' # initial value
  apiUrl: http://a4235a7ee247011e8aa6f0213eb6eb14-1392003683.us-west-2.elb.amazonaws.com/myapp4
</code></pre>

<p>after updating the configmap.yaml</p>

<p>configmap.yaml</p>

<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: app1-config
  namespace: default
data:
  envVal: '56789' # changed value
  apiUrl: http://a4235a7ee247011e8aa6f0213eb6eb14-1392003683.us-west-2.elb.amazonaws.com/myapp4
</code></pre>

Shruthi Bhaskar
<p>When you mount the keys from the ConfigMap as environment variables, you would need to restart your pod for the changes to take effect.</p>

<p>When you mount it as volume into you system, the files in the volume will be updated automatically. The update is not immediate, there is some TTL configured in the <code>kubelet</code> before it checks for changes / does the update. But it is normally quite quick. However it would still depend on your application how it loads the data from the file - whether it will be able to update its self <em>on the fly</em> when the files change or whether these data were loaded only once at startup.</p>
