github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/examples/template-override/template-overrides-example.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://kubernetes.default.svc
    17        template:
    18          metadata: {}
    19          spec:
    20            project: "default"
    21            source:
    22              targetRevision: HEAD
    23              repoURL: https://github.com/argoproj/argo-cd.git
    24              path: 'applicationset/examples/template-override/{{.cluster}}-override'
    25            destination: {}
    26  
    27    template:
    28      metadata:
    29        name: '{{.cluster}}-guestbook'
    30      spec:
    31        project: "default"
    32        source:
    33          repoURL: https://github.com/argoproj/argo-cd.git
    34          targetRevision: HEAD
    35          path: applicationset/examples/template-override/default
    36        destination:
    37          server: '{{.url}}'
    38          namespace: guestbook