roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.03k stars 567 forks source link

selector labels renders all releases within helmfiles. #2182

Open tanwar4 opened 7 months ago

tanwar4 commented 7 months ago

What is the benefit of using selector labels if the helmfile renders all releases within it. Is there a way to only render the releases selected by labels so that I do not have to pass required environment parameters that are not required by selected release?

templates:
  default:
    values:
      - global:
          foo: {{ requiredEnv "foo" | quote }}
          bar: {{ requiredEnv "bar" }}
      - ../file/common.yaml

releases:
  - name: rel1
    chart: repo/chart1
    version: 0.1.0
    labels:
      tier: label1
    inherit:
      - template: default
    values:
      - global:
          BUZZ: {{ requiredEnv "buzz" }}

  - name: rel2
    chart: repo/chart2
    version: 0.1.0
    labels:
      tier: label2
    inherit:
      - template: default

For the above helmfile, even when I just want to deploy rel2, I have to pass "buzz" env variable. Is there a way to just deploy rel2 without passing "buzz"?

  This works- 
  buzz=TEST helmfile sync -l tier=label2

  This does not work- 
  helmfile sync -l tier=label2