<p>I created configmap this way.</p>
<pre><code>kubectl create configmap some-config --from-literal=key4=value1
</code></pre>
<p>After that i created pod which looks like this</p>
<p>.<a href="https://i.stack.imgur.com/rhFYE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rhFYE.png" alt="enter image description here" /></a></p>
<p>I connect to this pod this way</p>
<pre><code>k exec -it nginx-configmap -- /bin/sh
</code></pre>
<p>I found the folder <code>/some/path</code> but i could get value from key4.</p>

O.Man
<p>If you refer to your <code>ConfigMap</code> in your <code>Pod</code> this way:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: nginx
      volumeMounts:
      - mountPath: &quot;/var/www/html&quot;
        name: config-volume
  volumes:
    - name: config-volume
      configMap:
        name: some-config
</code></pre>
<p>it will be available in your <code>Pod</code> as a file <code>/var/www/html/key4</code> with the content of <code>value1</code>.</p>
<p>If you rather want it to be available as an <strong>environment variable</strong> you need to refer to it this way:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: nginx
      envFrom:
      - configMapRef:
          name: some-config
</code></pre>
<p>As you can see you don't need for it any volumes and volume mounts.</p>
<p>Once you connect to such <code>Pod</code> by running:</p>
<pre><code>kubectl exec -ti mypod -- /bin/bash
</code></pre>
<p>You will see that your environment variable is defined:</p>
<pre><code>root@mypod:/# echo $key4
value1
</code></pre>
