<p>What is the difference between <code>env</code> and <code>envFrom</code> fields in kubernetes when referencing secrets? Thank you!</p>

<p>Below is the <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">&quot;env:&quot;</a> sample which will load variables into container environment as environment variables which can referenced using &quot;$DEMO_GREETING&quot; then you will get &quot;Hello from the environment&quot;</p>
<pre><code>    env:
    - name: DEMO_GREETING
      value: &quot;Hello from the environment&quot;
    - name: DEMO_FAREWELL
      value: &quot;Such a sweet sorrow&quot;
</code></pre>
<p>Similarly you can load <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">secret</a> as environment variable as below</p>
<pre><code>  envFrom:
  - secretRef:
      name: mysecret
</code></pre>
<p>Here the secret will be loaded as environment variable and this can be referenced as $mysecret inside the container.</p>
