Use values-production.yaml instead of values.yaml for Helm Dependencies

2/20/2020

I am creating a helm chart that uses multiple dependencies. For some of those dependencies I would like to use their values-production.yaml instead of the default values.yaml. I have tried adding a tag section to the dependencies to call the production values but that doesn't seem to work. For example the redis chart has production-values.yaml and values.yaml. Is there a way for me to use the production-values within my chart's dependencies?

Eg my helm Chart.yaml looks like:

 apiVersion: v2
 name: parentChart
 ...
 dependencies:
  - name: redis
    version: 10.5.3
    repository: "@stable"
    tags:
     - prd-values
-- imapotatoe123
helmfile
kubernetes
kubernetes-helm

1 Answer

2/21/2020

There are two ways to provide your values file.

helm install -f myvals.yaml ./mychart
helm install --set foo=bar ./mychart
The order of specificity: values.yaml is the default, which can be overridden by a parent chart’s values.yaml, which can in turn be overridden by a user-supplied values file, which can in turn be overridden by --set parameters.

This means if you have same values in your values.yaml and values-production.yaml then only values-production.yaml will be used as it will overwrite the fields in values.yaml.

-- anmol agrawal
Source: StackOverflow