# What is the best way to update environment variables coming from a configmap?

**URL:** <https://discuss.kubernetes.io/t/what-is-the-best-way-to-update-environment-variables-coming-from-a-configmap/5222>\
**Category:** General Discussions\
**Tags:** development\
**Created:** [March 4, 2019, 4:33pm UTC](https://discuss.kubernetes.io/t/what-is-the-best-way-to-update-environment-variables-coming-from-a-configmap/5222 "2019-03-04T16:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak905](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/zak905/32/653_2.png) [@zak905](https://discuss.kubernetes.io/u/zak905)\
**Post date:** [March 4, 2019, 4:33pm UTC](https://discuss.kubernetes.io/t/what-is-the-best-way-to-update-environment-variables-coming-from-a-configmap/5222/1 "2019-03-04T16:33:23Z")

</div>

Hello,

is there anyway to update environment variables injected using a config map (`envFrom` directive) on the fly ?  
The only way I found is restarting the pod after changing the config. is there a more elegant way ?

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [March 4, 2019, 4:48pm UTC](https://discuss.kubernetes.io/t/what-is-the-best-way-to-update-environment-variables-coming-from-a-configmap/5222/2 "2019-03-04T16:48:09Z")

</div>

Env vars live within the process. You can not change them from  
outside. This is their major failing.

---

<div class="post-metadata">

**Author:** ![zak905](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/zak905/32/653_2.png) [@zak905](https://discuss.kubernetes.io/u/zak905)\
**Post date:** [March 4, 2019, 7:25pm UTC](https://discuss.kubernetes.io/t/what-is-the-best-way-to-update-environment-variables-coming-from-a-configmap/5222/3 "2019-03-04T19:25:55Z")

</div>

That would be a cool feature.
