<p>I want to inject the following secret key/value in pods: test-with=1 and testwith=1. First I create the secret:</p>
<pre><code>kubectl create secret generic test --from-literal=test-with=1 --from-literal=testwith=0
</code></pre>
<p>Then I create a yaml file for a pod with the following specification:</p>
<pre><code>containers:
  ...
  envFrom:
    - secretRef:
        name: test
</code></pre>
<p>The pod is running, but the result of env command inside the container only shows:</p>
<pre><code>...
TERM=xterm
testwith=0
...
</code></pre>
<p>The test-with=1 does not show up. How can i declare the secret to see the key/value?</p>

Xaving
<p>Variables with delimitations in names are displayed at the top when viewed through <code>printenv</code>.</p>
<p>Checked:</p>
<pre><code>$ kubectl create secret generic test --from-literal=test-with=1 --from-literal=testwith=0

$ kubectl get secret/test -o yaml
apiVersion: v1
data:
  test-with: MQ==
  testwith: MA==
kind: Secret
metadata:
  ...
</code></pre>
<pre><code>cat &lt;&lt;EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: check-env
spec:
  volumes:
  - name: shared-data
    emptyDir: {}
  containers:
  - name: nginx
    image: nginx
    envFrom:
    - secretRef:
        name: test
    volumeMounts:
    - name: shared-data
      mountPath: /usr/share/nginx/html
  hostNetwork: true
  dnsPolicy: Default
EOF
</code></pre>
<pre><code>$ kubectl exec -it shell-demo -- printenv | grep test

test-with=1
testwith=0
</code></pre>
<p><code>GKE v1.18.16-gke.502</code></p>
