<p>I have the following configmap spec:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
data:
  MY_NON_SECRET: foo
  MY_OTHER_NON_SECRET: bar
kind: ConfigMap
metadata:
  name: web-configmap
  namespace: default
</code></pre>
<pre><code>$ kubectl describe configmap web-configmap
Name:         web-configmap
Namespace:    default
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;

Data
====
MY_NON_SECRET:
----
foo
MY_OTHER_NON_SECRET:
----
bar
Events:  &lt;none&gt;
</code></pre>
<p>And the following pod spec:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: web-pod
spec:
  containers:
    - name: web
      image: kahunacohen/hello-kube:latest
      envFrom:
        - configMapRef:
            name: web-configmap
      ports:
      - containerPort: 3000
</code></pre>
<pre><code>$ kubectl describe pod web-deployment-5bb9d846b6-8k2s9
Name:         web-deployment-5bb9d846b6-8k2s9
Namespace:    default
Priority:     0
Node:         minikube/192.168.49.2
Start Time:   Mon, 12 Jul 2021 12:22:24 +0300
Labels:       app=web-pod
              pod-template-hash=5bb9d846b6
              service=web-service
Annotations:  &lt;none&gt;
Status:       Running
IP:           172.17.0.5
IPs:
  IP:           172.17.0.5
Controlled By:  ReplicaSet/web-deployment-5bb9d846b6
Containers:
  web:
    Container ID:   docker://8de5472c9605e5764276c345865ec52f9ec032e01ed58bc9a02de525af788acf
    Image:          kahunacohen/hello-kube:latest
    Image ID:       docker-pullable://kahunacohen/hello-kube@sha256:930dc2ca802bff72ee39604533342ef55e24a34b4a42b9074e885f18789ea736
    Port:           3000/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Mon, 12 Jul 2021 12:22:27 +0300
    Ready:          True
    Restart Count:  0
    Environment:    &lt;none&gt;
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-tcqwz (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  kube-api-access-tcqwz:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       &lt;nil&gt;
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              &lt;none&gt;
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  19m   default-scheduler  Successfully assigned default/web-deployment-5bb9d846b6-8k2s9 to minikube
  Normal  Pulling    19m   kubelet            Pulling image &quot;kahunacohen/hello-kube:latest&quot;
  Normal  Pulled     19m   kubelet            Successfully pulled image &quot;kahunacohen/hello-kube:latest&quot; in 2.3212119s
  Normal  Created    19m   kubelet            Created container web
  Normal  Started    19m   kubelet            Started container web
</code></pre>
<p>The pod has container that is running expressjs with this code which is trying to print out the env vars set in the config map:</p>
<pre class="lang-js prettyprint-override"><code>const process = require(&quot;process&quot;);
const express = require(&quot;express&quot;);
const app = express();


app.get(&quot;/&quot;, (req, res) =&gt; {
  res.send(`&lt;h1&gt;Kubernetes Expressjs Example 0.3&lt;/h2&gt;
  &lt;h2&gt;Non-Secret Configuration Example&lt;/h2&gt;
  &lt;p&gt;This uses ConfigMaps as env vars.&lt;/p&gt;
  &lt;ul&gt;
    &lt;li&gt;MY_NON_SECRET: &quot;${process.env.MY_NON_SECRET}&quot;&lt;/li&gt;
    &lt;li&gt;MY_OTHER_NON_SECRET: &quot;${process.env.MY_OTHER_NON_SECRET}&quot;&lt;/li&gt;
  &lt;/ul&gt;
  `);
});


app.listen(3000, () =&gt; {
  console.log(&quot;Listening on http://localhost:3000&quot;);
})
</code></pre>
<p>When I deploy these pods, the env vars are <code>undefined</code></p>
<p>When I do <code>$ kubectl exec {POD_NAME} -- env</code></p>
<p>I don't see my env vars.</p>
<p>What am I doing wrong? I've tried killing the pods, waiting till they restart then check again to no avail.</p>

Aaron
<p>It looks like your pods are managed by <code>web-deployment</code> deployment. You cannot patch such pods directly.</p>
<p>If you run <code>kubectl get pod &lt;pod-name&gt; -n &lt;namespace&gt; -oyaml</code>, you'll see a block called <code>ownerReferences</code> under the <code>metadata</code> section. This tells you who is the owner/manager of this pod.</p>
<p>In case of a deployment, here is the ownership hierarchy:</p>
<p><strong>Deployment</strong> -&gt; <strong>ReplicaSet</strong> -&gt; <strong>Pod</strong></p>
<p>i.e. A deployment creates replicaset and replicaset in turn creates pod.</p>
<p>So, if you want to change anything in the pod Spec, you should make that change in the <em>deployment</em>, not in the replicaset or the pod directly as they will get overwritten.</p>
<p>Patch your deployment either by running and edit the environment field there:</p>
<pre><code>kubectl edit deployment.apps &lt;deployment-name&gt; -n &lt;namespace&gt;
</code></pre>
<p>or update the deployment yaml with your changes and run</p>
<pre><code>kubectl apply -f &lt;deployment-yaml-file&gt;
</code></pre>
