github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/examples/matrix/cluster-and-git.yaml (about)

     1  # This example demonstrates the combining of the git generator with a cluster generator
     2  # The expected output would be an application per git directory and a cluster (application_count = git directory * clusters)
     3  #
     4  #
     5  apiVersion: argoproj.io/v1alpha1
     6  kind: ApplicationSet
     7  metadata:
     8    name: cluster-git
     9  spec:
    10    goTemplate: true
    11    goTemplateOptions: ["missingkey=error"]
    12    generators:
    13    - matrix:
    14        generators:
    15          - git:
    16              repoURL: https://github.com/argoproj/argo-cd.git
    17              revision: HEAD
    18              directories:
    19              - path: applicationset/examples/matrix/cluster-addons/*
    20          - clusters:
    21              selector:
    22                matchLabels:
    23                  argocd.argoproj.io/secret-type: cluster
    24    template:
    25      metadata:
    26        name: '{{.path.basename}}-{{.name}}'
    27      spec:
    28        project: '{{.metadata.labels.environment}}'
    29        source:
    30          repoURL: https://github.com/argoproj/argo-cd.git
    31          targetRevision: HEAD
    32          path: '{{.path.path}}'
    33        destination:
    34          server: '{{.server}}'
    35          namespace: '{{.path.basename}}'