Description
We use argocd and kustomize to manage all the environment variables on each stage (namespace) in the cluster. The github that synchronize those configurations have the next files template: |- base
|- templates
|- serviceA.yaml
|- overlays
|- production
|- staging
|- .env
Into the overlays file, we can find a folder for each stage. All stages folder has a file named .env that has all the environment variables that will be used on each service. At the moment there is only one file so if you change it, it will modify all the services that use it. This file has been written using key value format as shown below:
SPA_IRIS_URL=https://stagingiris.1doc3.com
SPA_DOCTORES_URL=https://stagingdoctores.1doc3.com
SPA_ADMIN_URL=https://stagingclientes.1doc3.com
Some environment variables are overwritten by each ones are present on the configuration file for each service template.
Procedure
Update the main branch of the repository (pull). To add, remove or delete environment variables on a stage, modify the .env file. Commit and publish (push) the main branch of the repository.