argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.33k stars 4.93k forks source link

helm values files wildcard in multi source #18078

Open mysiki opened 2 weeks ago

mysiki commented 2 weeks ago

Summary

Add the availability to inject helm values files with wildcard in Application and ApplicationSet.

Motivation

As generator cannot merge all the files (matrix / merge are limitated to 2 levels) it can be good to use * in valuesFile for helm.

Specially because argo have this really good capacity to load files from external git repo ! This allow to manage external values files woth auto loading and avoid to change the application to inject new data. As the files are merge, it will be really simple to split data files.

Currently :

      sources:
        - helm:
            valueFiles:
              - $externalNames/prd/subnets.yaml
              - $externalNames/prd/vpcs.yaml
              - $externalNames/prd/instancesByAccount.yaml
              - $externalNames/prd/route53HostedZones.yaml
              - $globalconfig/configuration.yaml
          path: Chart
          repoURL: >-
            https://gitlab.XXX/YYYY
          targetRevision: develop
        - ref: globalconfig
          repoURL: >-
            https://gitlab.XXX/BBB
          targetRevision: 1.1.0
        - ref: externalNames
          repoURL: >-
            https://gitlab.XXX/CCC
          targetRevision: master

Proposal

Just with glob patern inside valuesFiles (for application AND applicationSet)

      sources:
        - helm:
            valueFiles:
              - $externalNames/prd/*.yaml
              - $globalconfig/configuration.yaml
          path: Chart
          repoURL: >-
            https://gitlab.XXX/YYYY
          targetRevision: develop
        - ref: globalconfig
          repoURL: >-
            https://gitlab.XXX/BBB
          targetRevision: 1.1.0
        - ref: externalNames
          repoURL: >-
            https://gitlab.XXX/CCC
          targetRevision: master
gioppoluca commented 1 week ago

this could be useful