<p>The <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/secret" rel="noreferrer">docs states</a> that </p>

<blockquote>
  <p>To create a Secret from one or more files, use --from-file. You
  specify files in any plaintext format, such as .txt or .env, as long
  as the files contain key-value pairs.</p>
</blockquote>

<p><em>.test-secret</em></p>

<pre><code>NAME=martin
GENDER=male
</code></pre>

<p><strong>Testing to create a secret based on my .test-secret file.</strong></p>

<pre><code>kubectl create secret generic person --from-file .test-secret -o yml

$ kubectl get secret person -o yaml
apiVersion: v1
data:
  .test-secret: TkFNRT1tYXJ0aW4KR0VOREVSPW1hbGUK
kind: Secret
metadata:
  creationTimestamp: 2018-07-19T09:23:05Z
  name: person
  namespace: default
  resourceVersion: "229992"
  selfLink: /api/v1/namespaces/default/secrets/person
  uid: 579198ab-8b35-11e8-8895-42010a840008
type: Opaque
</code></pre>

<p>Is it possible to read a list of key / values like that? Is it even possible to do so from an <code>.env</code> file? <code>kubectl get pods</code> returns <em>CreateContainerConfigError</em></p>

<p><strong>my-app.yml</strong></p>

<pre><code> 77             - name: NAME
 78               valueFrom:
 79                 secretKeyRef:
 80                   name: person
 81                   key: NAME
</code></pre>

<p>Yes, use the option --from-env-file</p>
<pre><code>kubectl create secret generic person --from-env-file=.test-secret
</code></pre>
<p>To consume the secrets from the initial .env file in a pod, you can use the following :</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: some-meta
spec:
  containers:
  - name: xyz
    image: abc
    envFrom:
    - secretRef:
        name: person # &lt;--
</code></pre>
