<p>To begin with - let us suppose we have a React application. We want to build it and deploy to 3 environments - dev, test and production. As every front-end app it needs to call some APIs. API addresses will vary between the environments. So they should be stored as environment variables.</p>

<p>As every modern, progressive developer we want to use containers. In particular Kubernetes.</p>

<p>We want to build our web application and deploy it on K8S cluster. The container image should be built and kind of sealed for changes, then before deployment to each particular environment the variables should be injected.</p>

<p>But it seems there's one great impossibility here. When it comes to .NET apps for example, when we have .dll compiled, it reads a config file in the runtime. It's not a case with React. After we generate build we have just static files. The variables are changed to static values in the process of building React app. It seems there's no way to update it after that point - or is it?</p>

Arkadiusz Kałkus
<p>The way you are trying to solve your problem is not correct. </p>

<p>You don't need to know anything about the addresses of the backend services in your react app. Only the frontend server/gateway that is serving your react app needs to know about the backend services. Any request from the react app should be proxied via the gateway.</p>

<p>See API gateway pattern - <a href="https://microservices.io/patterns/apigateway.html" rel="nofollow noreferrer">https://microservices.io/patterns/apigateway.html</a></p>
