Interview Prep/GitOps & Argo CD/ApplicationSets, App-of-Apps & Multi-Cluster

Show a list generator example.

BeginnerConceptApplicationSets, App-of-Apps & Multi-Cluster
Answer
spec:
  goTemplate: true
  generators:
    - list:
        elements:
          - env: dev
            cluster: in-cluster
          - env: prod
            cluster: prod-eu
  template:
    metadata:
      name: "web-{{ .env }}"
    spec:
      project: web
      source:
        repoURL: https://github.com/org/cfg.git
        targetRevision: main
        path: "apps/web/overlays/{{ .env }}"
      destination:
        name: "{{ .cluster }}"
        namespace: web
All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on ApplicationSets, App-of-Apps & Multi-Cluster