Can I have multiple values.yaml files for Helm

后端 未结 3 1773
夕颜
夕颜 2021-01-31 08:03

Can I have multiple values.yaml files in a Helm chart?

Something like mychart/templates/internalValues.yaml, mychart/templates/customSett

3条回答
  •  星月不相逢
    2021-01-31 08:56

    Helm by default will only use the values.yaml file in the root directory of your chart.

    You can ask it to load additional values files when you install. For instance, if you have any settings that point to different databases in different environments:

    helm install . -f values.production.yaml
    

    You could also get a similar effect by bundling additional settings as a file, and asking Helm to read the bundled file. Helm provides an undocumented fromYaml template function which can parse the file, so in principle you can do something like

    {{- $v := $.Files.Get "more-values.yaml" | fromYaml }}
    foo: {{ $v.bar }}
    

提交回复
热议问题