argoproj-labs / argocd-vault-plugin

An Argo CD plugin to retrieve secrets from Secret Management tools and inject them into Kubernetes secrets
https://argocd-vault-plugin.readthedocs.io
Apache License 2.0
783 stars 184 forks source link

ApplicatonSet With Helm #638

Open giovannipajeu1 opened 1 month ago

giovannipajeu1 commented 1 month ago

Hi, I have an applicationSet called Postgresql, in which I deploy it to 3 clusters, being prod, dev and control. I use the helm chart bitnami and I pass specific values ​​from my repository pointing to the name with a variable, this way, I deploy it to the 3 clusters with dynamic data, however, I need to pass the secret via vault and I didn't find documentation that helped me do it this way.

my code is something like

`apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: postgresql
spec:
  generators:
    - list:
        elements:
          - cluster: control
          - cluster: dev
          - cluster: prod
  goTemplate: true
  goTemplateOptions:
    - missingkey=error
  template:
    metadata:
      name: 'postgresql-{{.cluster}}'
    spec:
      destination:
        namespace: postgresql
        server: '{{.url}}'
      project: infra
      sources:
      - chart: postgresql
        helm:
          releaseName: postgresql
          valueFiles:
          - $values/infra/values/postgresql.yaml
          - $values/infra/values/postgresql-{{.cluster}}.yaml
        repoURL: 'https://charts.bitnami.com/bitnami'
        targetRevision: '*'
      - repoURL: meu-repo-sitorio
        targetRevision: main
        ref: values
        plugin:
          name: argocd-vault-plugin-helm
      syncPolicy:
        syncOptions:
        - CreateNamespace=true
        - ApplyOutOfSyncOnly=true
        - PruneLast=true
`

As you can see, I added the argocd-vault-helm plugin via sidecar according to the manual, but now I have problems using it this way