Search code examples
kubernetes-helmargocd

Pass in array of objects to Helm


I am new to Helm and see Helm chart values.yml with entries like:

extraEmptyDirMounts: []
  # - name: provisioning-notifiers
  #   mountPath: /etc/grafana/provisioning/notifiers

I can't for the life of me figure out how to pass that in through the Helm overrides in the format of:

spec:
  source:
    helm:
      parameters:
      - name: extraEmptyDirMounts
        value: ???

I've Googled around and am yet to find a clear example of this since it seems pretty common.

Somehow, this array of objects is supposed to be encoded in the single value parameter.


Solution

  • Argo CD supports passing in structured Helm values, either as a YAML object or as an encoded string. I'd use valuesObject: over parameters: here.

    spec:
      source:
        helm:
          valuesObject:
            extraEmptyDirMounts:
              - name: provisioning-notifiers
                mountPath: /etc/grafana/provisioning/notifiers
    

    parameters: replicates the helm install --set syntax. This is a little bit unusual format, and you can't effectively use it to provide an array of nested objects (it's possible but rather unpleasant).