<p>I need to pass "PODIP" env value to configmap for configuration during k8s deployment</p>

<p>deploy.yaml</p>

<pre><code>- env:
  - name: PODIP
    valueFrom:
      fieldRef:
        fieldPath: status.podIP
</code></pre>

<p>how to do this? 10x</p>

Maurice Amar
<p>I did small research on topic and it come out that a configmap was <strong>intentionally</strong> made <a href="https://github.com/kubernetes/kubernetes/issues/62099" rel="nofollow noreferrer">ReadOnly</a> some time ago. </p>

<p>If you really need interacting with files from a configmap then you could instead put the files in a writeable volume and  <a href="https://stackoverflow.com/questions/45681206/what-would-be-an-ideal-way-to-share-writable-volume-across-containers-for-a-web">mount the volume</a>. 
Or you could to use the centralized configuration like consul. </p>

<p>Addtionally, you can try storing values in a database. Another option to store configuration information could be a distributed cache  <a href="https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-4-service-discovery-and-configuration/5-4-1-using-redis-to-store-configuration-information/" rel="nofollow noreferrer">such as redis</a> or hazelcast, etc.</p>

<p>That is <a href="https://github.com/kubernetes/kubernetes/pull/60258/files" rel="nofollow noreferrer">Pull request</a>  which made ConfigMaps ReadOnly.</p>

<p>Hope that helps.
Let me know if that was the info you've been looking for :)</p>
