kube helm charts - multiple values files

5/5/2020

it might be simple question but can't find anywhere if it's duable;

Is it possible to have values files for helm charts (stable/jenkins let's say) and have two different values files for it?

I would like in values_a.yaml have some values like these:

master:
  componentName: "jenkins-master"
  image: "jenkins/jenkins"
  tag: "lts"
...
  password: {{ .Values.secrets.masterPassword }}

and in the values_b.yaml - which will be encrypted with AWS KMS

secrets:
  masterPassword: xxx

the above code doesn't work and wanted to know, as you can put those vars in kube manifests like it

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.config.name }}
  namespace: {{ .Values.config.namespace }}
...

can they be somehow passed to other values files


EDIT:

If it was possible I would just put the

master:
  password: xxx

in values_b.yaml but vars cannot be duplicated, and the official helm chart expects the master.password val from that file - so has to somehow pass it there but in encrypted way

-- potatopotato
kubernetes
kubernetes-helm

1 Answer

5/5/2020

I'm not quite sure but this feature of helm might help you.

Helm gives you the functionality to pass custom Values.yaml which have higher precedence over the fields of the main Values.yaml while performing helm install or helm upgrade.

For Helm 3

$ helm install <name> ./mychart -f myValues.yaml

For Helm 2

$ helm install --name <name> ./mychart --values myValues.yaml
-- Kamol Hasan
Source: StackOverflow