Different deployment configurations using Helm

3/6/2019

I would like to have a slightly different deployment configuration in different invironments. That is, in Prod and Ver, I don't want all containers to be deployed.

With docker-compose we solve that by having incremental docker-compose files that we combine, like: docker-compose up -f docker-compose.yml -f docker-compose-prod.yml

How can that be done using Helm charts? We have a structure with Chart.yaml and values.yaml in the top, and then one yaml file per container in a subfolder. The naive solution would be to copy that structure and leave out some of the chart files, but I would prefer to have only one file (at most one file!) per service.

We deploy to AKS using CircleCI.

To summarize: Today, each service has it's own yaml file, and on every deploy, all of them gets deployed. I want to configure my charts so that only a subset of the services gets deployed in certain environments.

EDIT:

kubectl has the the possibility to use selectors, like kubectl create cfg.yaml --selector=tier=frontend or kubectl create cfg.yaml --selector=environment=prod and I already tag my containers, so that would have been simple. But helm install does not have the possibility to accept a similar flag and pass it to kubectl.

-- Göran Roseen
kubernetes-helm

1 Answer

3/6/2019

just create one values file for each environment and target those:

helm install . -f values.production.yaml
helm install . -f values.development.yaml

you can use condition to toggle deployments, imagine you have something,yaml which you want conditionally deployed:

{{ if .Values.something}}
something.yaml original content goes here
{{ end }}
-- 4c74356b41
Source: StackOverflow