argoproj/applicationset

Ability to provide multiple values files for Helm chart, using multiple sources

wojciechka opened this issue · 3 comments

ApplicationSet does not currently support an easy way to provide an array of values files. Until recently, I have been using ApplicationSet and a workaround I found in multiple places - providing a comma-separated list of files as single item to valueFiles.

After upgrading to ArgoCD 2.6, I am trying to leverage multiple sources and continue to use ApplicationSet to control it.

This works as long as items for valueFiles are inside the repository where the Helm chart is, but it's not possible to reference a file from another sources.

Here's a minimal snippet to reproduce it:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: configtest
  namespace: argocd
spec:
  generators:
  - list:
      elements:
      - chart: ""
        name: configtest-working
        path: charts/configtest
        releaseName: configtest
        repoURL: .../path/to/chart-repo.git
        targetRevision: configtest
        # referencing two values files from Git repo containing the chart
        valueFiles: 'values.yaml,values-prod.yaml'
      - chart: ""
        name: configtest-not-working
        path: charts/configtest
        releaseName: configtest
        repoURL: .../path/to/chart-repo.git
        targetRevision: configtest
        # referencing external source does not work
        valueFiles: 'values.yaml,$config/values-prod.yaml'
  template:
    metadata:
      name: configtest-{{ name }}
    spec:
      destination:
        namespace: configtest
        server: https://kubernetes.default.svc
      project: configtest
      sources:
      - chart: '{{ chart }}'
        helm:
          releaseName: '{{ releaseName }}'
          valueFiles:
          - '{{ valueFiles }}'
        path: '{{ path }}'
        repoURL: '{{ repoURL }}'
        targetRevision: '{{ targetRevision }}'
      - ref: config
        repoURL: .../path/to/config.git
        targetRevision: main

It's understandable why the workaround does not work, but lack of multiple (and arbitrary number of) values files makes it difficult to deploy complex workloads using ArgoCD and ApplicationSet CRs.

Is there a way to preferably pass an array as one of the values for list generator and then pass that as value for valueFiles?

any update?

eripa commented

There are a couple of issues in the main Argo CD repo tracking this:
argoproj/argo-cd#11213
argoproj/argo-cd#9583

It's not presently possible to use OCI as a dependent chart, would like to use the workaround as defined here:
argoproj/argo-cd#12436