github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/examples/design-doc/template-override.yaml (about)

     1  # App templates can also be defined as part of the generator's template stanza. Sometimes it is
     2  # useful to do this in order to override the spec.template stanza, and when simple string
     3  # parameterization are insufficient. In the below examples, the generators[].XXX.template is 
     4  # a partial definition, which overrides/patch the default template.
     5  apiVersion: argoproj.io/v1alpha1
     6  kind: ApplicationSet
     7  metadata:
     8    name: guestbook
     9  spec:
    10    goTemplate: true
    11    goTemplateOptions: ["missingkey=error"]
    12    generators:
    13    - list:
    14        elements:
    15          - cluster: engineering-dev
    16            url: https://1.2.3.4
    17        template:
    18          metadata: {}
    19          spec:
    20            project: "project"
    21            source:
    22              repoURL: https://github.com/infra-team/cluster-deployments.git
    23              path: '{{.cluster}}-override'
    24            destination: {}
    25  
    26    - list:
    27        elements:
    28          - cluster: engineering-prod
    29            url: https://1.2.3.4
    30        template:
    31          metadata: {}
    32          spec:
    33            project: "project2"
    34            source:
    35              repoURL: https://github.com/infra-team/cluster-deployments.git
    36              path: '{{.cluster}}-override2'
    37            destination: {}
    38  
    39    template:
    40      metadata:
    41        name: '{{.cluster}}-guestbook'
    42      spec:
    43        project: "project"
    44        source:
    45          repoURL: https://github.com/infra-team/cluster-deployments.git
    46          targetRevision: HEAD
    47          path: guestbook/{{.cluster}}
    48        destination:
    49          server: '{{.url}}'
    50          namespace: guestbook