Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

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

@wojciechka

Description

@wojciechka

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions