Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have multiple values.yaml files for Helm

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

Something like mychart/templates/internalValues.yaml, mychart/templates/customSettings.yaml, etc?

Accessing properties in a values.yaml file can be done by {{ .Values.property1 }}. How would I reference the properties in these custom values.yaml files?

like image 291
James Isaac Avatar asked Jun 29 '18 08:06

James Isaac


People also ask

How do I give multiple values in YAML?

In YAML, Array represents a single key mapped to multiple values. Each value starts with a hyphen - symbol followed by space. In a single line, write the same thing above using 'square brackets syntax. '

How do I override values YAML in Helm?

You can use a --set flag in your Helm commands to override the value of a setting in the YAML file. Specify the name of the setting and its new value after the --set flag in the Helm command. The --set flag in the above command overrides the value for the <service>. deployment.

Do Helm chart has YAML files in its package?

yaml is used by many of the Helm tools, including the CLI. When generating a package, the helm package command will use the version that it finds in the Chart. yaml as a token in the package name. The system assumes that the version number in the chart package name matches the version number in the Chart.


1 Answers

Yes, it's possible to have multiple values files with Helm. Just use the --values flag (or -f).

Example:

helm install ./path --values ./internalValues.yaml --values ./customSettings.yaml 

You can also pass in a single value using --set.

Example:

helm install ./path --set username=ADMIN --set password=${PASSWORD} 

From the official documentation:

There are two ways to pass configuration data during install:

--values (or -f): Specify a YAML file with overrides. This can be specified multiple times and the rightmost file will take precedence

--set (and its variants --set-string and --set-file): Specify overrides on the command line.

If both are used, --set values are merged into --values with higher precedence. Overrides specified with --set are persisted in a configmap. Values that have been --set can be viewed for a given release with helm get values . Values that have been --set can be cleared by running helm upgrade with --reset-values specified.

like image 157
Ethan Strider Avatar answered Sep 24 '22 15:09

Ethan Strider