<p>I have a NodeJS app that renders server-side ReactJS components.</p>

<p>When I populate the environment variables via the deployment file.
It seems as my NodeJS server or ReactJS app does not see my environment variables. </p>

<p>How does envs work here?</p>

<p>When I build the image.
I can set the envs there.</p>

<p>But that is being set via the Kubernetes Deployment file.</p>

<p>We are using <em>webpack</em> to build the server.</p>

<p>I tried building the image with the envs inside it.
I tried building the image without the envs inside it.</p>

<p>When I do a <code>console.log(process.env)</code>, I don't see the envs populated in the deployment file for Kubernetes.</p>

Mark Richardson
<p>you cant <code>get</code> environment variables from the reactjs app, since it happens in the client browser. you can set them at build time or do some sort of parsing before the application starts to preprocess js files with a script\init container</p>

<p><a href="https://medium.com/@trekinbami/using-environment-variables-in-react-6b0a99d83cf5" rel="nofollow noreferrer">https://medium.com/@trekinbami/using-environment-variables-in-react-6b0a99d83cf5</a></p>
