<p>A question regarding a multi-stage-environment in Kubernetes. </p>

<p>I got a dev,test,prod K8-Cluster, and I got environment variables that differ from stage to stage (like Backend-urls). </p>

<p>I was thinking of using the init-container for replacing the backend-urls per stage, so it's not hardcoded and you can change the urls, if something changes. </p>

<p>Is this an anti-pattern or would you just pack the backends together with the frontend (which is not really possible because we sometimes got more than one different backend-url)</p>

noircc
<p>you should use configmaps to set the environment variables 
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/</a></p>

<p>example for angular:
<a href="https://stackoverflow.com/questions/55080966/configmaps-angular">Configmaps - Angular</a></p>
