Single app multi envs
When we work with helm, sometimes we need dynamics chose environment.
export CI_ENVIRONMENT_NAME=stage
helm upgrade --install my-release my-chart-repo/my-chart-app -f values/_.yml -f values/$CI_ENVIRONMENT_NAME.yaml
Project structure
.
├── helmwave.yml.tpl
└── values
├── _.yml
├── prod.yml
├── qa.yml
└── stage.yml
cat helmwave.yml.tpl
version: 0.27.3
releases:
- name: my-release
chart:
name: my-chart-repo/my-chart-app
# yaml says "Who is the last one is right."
values:
# Default
- values/_.yml
# For specific ENVIRONMENT
- values/{{ requiredEnv "CI_ENVIRONMENT_NAME" }}.yml
create_namespace: true
cat values/_.yml
image:
tag: {{ env "CI_COMMIT_TAG" }}
podAnnotations:
gitCommit: {{ requiredEnv "CI_COMMIT_SHORT_SHA" | quote }}
cat values/prod.yml
replicaCount: 6
cat values/qa.yml
replicaCount: 2
cat values/stage.yml
replicaCount: 4
Run
export CI_ENVIRONMENT_NAME=stage
helmwave yml
helmwave build
helmwave up
or in one command
helmwave up --build --yml