Search code examples
kubernetes-helmargocdgitops

Using multiple sources in ArgoCD and solving extra templates/


I have read documentation at https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/

It has an example how to specify values.yaml and extra values files that are in another git repository:

apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  sources:
  - repoURL: 'https://prometheus-community.github.io/helm-charts'
    chart: prometheus
    targetRevision: 15.7.1
    helm:
      valueFiles:
      - $values/charts/prometheus/values.yaml
  - repoURL: 'https://git.example.com/org/value-files.git'
    targetRevision: dev
    ref: values

Is there a way to provide location of templates/ directory that exists in another git repository? So I can deploy extra K8s manifests from there.

In Helm, usually you put (extra) yaml files in templates/ directory so Helm renders them.


Solution

  • If you want to add only "static" manifests (with no Helm templating), you can use ArgoCD multi-sources feature like this:

        spec:
          sources:
            # Helm chart + values
            - repoURL: https://some-helm-registry
              chart: the-chart
              targetRevision: x.y.z
              helm:
                valueFiles:
                  - $values/some-path/values.yaml
            - repoURL: http://git-repo/project.git
              targetRevision: HEAD
              ref: values
            # Extra resources
            - repoURL: http://git-repo/other-project.git
              targetRevision: HEAD
              path: some-static-resources-path/