roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.05k stars 565 forks source link

How can i pass multiple Helm values files to a Kutomized Helm Chart ? #2183

Open jbouchery opened 10 months ago

jbouchery commented 10 months ago

Here is my use case, I would like to add a Secret manifest to a Helm Chart and i have multiple Helm Values files.

So far, i have tried something like this :

helmfile.yaml

environments: 
  dev:

---
repositories:
  - name: openfga
    url: https://openfga.github.io/helm-charts

releases:
  - name: openfga
    chart: ./kubernetes/kustomize
    createNamespace: true
    values:
      - ./kubernetes/values/values.yaml.gotmpl
      - ./kubernetes/values/{{ .Environment.Name }}.yaml

kubernetes/kustomize/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - name: openfga
    repo: https://openfga.github.io/helm-charts
    version: 0.1.31
    releaseName: openfga

resources:
  - secret.yaml

I also have a secret in kubernetes/kustomize/secret.yaml and some values in ./kubernetes/values/values.yaml.gotmpl and ./kubernetes/values/{{ .Environment.Name }}.yaml

My helmfile template command seems to correctly add the secret but not my values.

I have something if i add valuesFile to the helmCharts in my kusomization.yaml but i would like to avoid that because i can only have one values file.

Am i missing something ?

Thanks for your help

MattRipia commented 7 months ago

You want additionalValuesFiles: flag :)

helmCharts:
  - name: chartName
    repo: https://charts.<domain>.com/chart
    version: 4.5.6
    releaseName: <releaseName>
    namespace: <namespace>
    valuesFile: <../../base-values.yaml>
    additionalValuesFiles:
      - <environment.yaml>