Helm - Override list values with override file

Viewed 1846

I want to override values between prod and dev deployments.

The default values look like:

apps:
  myapp:
    replicaCount: 2
    containers:
      - name: foo
        env:
          MODE: "dev"

I can override this in command line with:

--set apps.myapp.containers[0].env.mode="prod"

However I want to keep all the overrides in a file and run helm upgrade passing in an override file as well. Adding the override in the file like:

apps:
  myapp:
    containers[0]:
      env:
        MODE: "prod"

does NOT work. How do I override values inside a list?

1 Answers

It is weird to say the least.

This worked:

apps:
  myapp:
    containers[1]:
      env:
        MODE: "prod"

So the index for containers is 1 when overridden in a file, however 0 when done using command line:

--set apps.myapp.containers[0].env.mode="prod"
Related