Interview Prep/GitOps & Argo CD/Environments, ApplicationSets & Multi-Cluster

You need different sync policies per cluster in a cluster-generated ApplicationSet: auto for staging, manual for prod. How?

IntermediateScenarioEnvironments, ApplicationSets & Multi-Cluster
Answer

Situation read → Conditional sync policy from cluster metadata.

What I'd do →

templatePatch: |
  {{- if eq (index .metadata.labels "env") "staging" }}
  spec:
    syncPolicy:
      automated:
        prune: true
        selfHeal: true
  {{- end }}

Why → The base template stays manual; the patch adds automation where the label allows it.

Interview tip → templatePatch needs goTemplate: true.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on Environments, ApplicationSets & Multi-Cluster