How to set multiple values with helm? How to set multiple values with helm? shell shell

How to set multiple values with helm?


According to https://github.com/kubernetes/helm/issues/1987#issuecomment-280497496, you set multiple values using curly braces, for example:

--set foo={a,b,c}

So, in your case it would be like this

--set aws.subnets={subnet-123456,subnet-654321}


The CLI format and limitations can vary depending on what would be expected in a YAML version. For example, if the YAML manifest requires fields to be populated with a list of values the YAML would look like this:

field:  - value1  - value2  - value3 

This would be expressed in the helm CLI like so

--set field[0]=value1 --set field[1]=value2 --set field[2]=value3

The documentation also refers to --set field={value1,value2,value3} working. In some cases that results in Error: This command needs 1 argument: chart name which is why I provide the above suggestion

There are also limitations to what characters may be used per the documentation:

You can use a backslash to escape the characters; --set name="value1\,value2" will become:

name: "value1,value2"


With this change being merged, Helm now supports using multiple --set command with helm install command.

Taking from the link mentioned above:

Manually tested, and looks awesome!

  helm install --dry-run --debug docs/examples/alpine \  --set foo=bar \  --set bar=baz,baz=lurman \  --set foo=bananaSERVER: "localhost:44134"CHART PATH: /Users/mattbutcher/Code/Go/src/k8s.io/helm/docs/examples/alpineNAME:   masked-monkeyREVISION: 1RELEASED: Thu Jan 12 17:09:07 2017CHART: alpine-0.1.0USER-SUPPLIED VALUES:bar: bazbaz: lurmanfoo: bananaCOMPUTED VALUES:Name: my-alpinebar: bazbaz: lurmanfoo: banana...

As expected, the last --set overrode the first --set.

P.S: Upgrade your Helm version in case this doesn't work for you. It worked perfectly for me with Helm-v3.0.1.