<p>I am passing some test variables to my pod which has code in nodejs like this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: envar-demo
  labels:
    purpose: demonstrate-envars
spec:
  containers:
  - name: envar-demo-container
    image: gcr.io/google-samples/node-hello:1.0
    send:
    - name: DEMO_GREETING
      value: &quot;Hello from the environment&quot;
    - name: DEMO_FAREWELL
      value: &quot;Such a sweet sorrow&quot;
</code></pre>
<p>I am trying to access the value of these variables from the <strong>package.json</strong> that I have inside my pod but I'm not sure how to do it, if I don't have an .env file from which I can read these variables using grep</p>

Carlos Daniel Ospina Salazar
<p>No matter how you have set the variable through Kubernetes, export, or just before calling a command. You can get access to it as in the usual bash script.</p>
<pre><code>&quot;scripts&quot;: {
  &quot;envvar&quot;: &quot;echo $TEST_ENV_VAR&quot;
},
</code></pre>
<p>Then we can run it</p>
<pre><code>➜ TEST_ENV_VAR=4342 npm run envvar

&gt; envvar
&gt; echo $TEST_ENV_VAR

4342
</code></pre>
