<p>When changing a variable in a configmap, the environment variables inside running pods are not updated.</p>
<p>We have a stateful pod that cannot be restarted easily.</p>
<p>Trying to update the environment variable inside the container with</p>
<p><code>export VARIABLE_TO_BE_UPDATED=&quot;new value&quot;</code></p>
<p>lasts a little while but is then rolled back automatically after some short time (maybe this has something to due with the open session).</p>
<p>Any way to update those environment variables (manually) in a persistent way without restarting the pod?</p>

<p>You can't reload a ConfigMap that was already mounted. The ConfigMap is read from the API and dumped into a volume before the container is started, it remains static afterwards.</p>
<p>Another way to do this could be to use a sidecard container, watching over changes to those ConfigMaps, refreshing copies in some volume that would be shared with your application container, then instructing your application to reload its configuration. A common implementation for this would be the <a href="https://github.com/pusher/prom-rule-reloader" rel="nofollow noreferrer">Prometheus Rule Reloader</a>.</p>
