Kustomize example with multiple environment variables.
There are 3 examples in this repo:
- shared environment variables + separate overlay environment variables
- shared environment variables + overlay environment variables (as patch)
- shared environment variables + separate overlay environment variables from multiple files
First example shows how to use shared environment variables from the base folder and separate environment variables from the overlay folder as config-map.
# Generate .yaml files
kustomize build ./overlays/dev
# Deploy
kustomize build ./overlays/dev | kubectl apply -f -
Second example shows how to combine/patch the shared env variables, by adding custom environment variables from the overlay folder as a config-map.
# Generate .yaml files
kustomize build ./overlays/pre-prod
# Deploy
kustomize build ./overlays/pre-prod | kubectl apply -f -
Third example hows how to use shared/generic environment variables from the base folder and combine multiple environment variables from different files within an overlay folder as a config-map.
# Generate .yaml files
kustomize build ./overlays/prod
# Deploy
kustomize build ./overlays/prod | kubectl apply -f -