Define a Multi-Stage-Environment UI (Angular) in Kubernetes

11/4/2019

A question regarding a multi-stage-environment in Kubernetes.

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

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.

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)

-- noircc
kubernetes
staging
user-interface

1 Answer

11/4/2019

you should use configmaps to set the environment variables https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/

example for angular: Configmaps - Angular

-- iliefa
Source: StackOverflow