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

You need to deploy the same app to dev, staging and prod namespaces with different values. Design it with an ApplicationSet.

IntermediateScenarioEnvironments, ApplicationSets & Multi-Cluster
Answer

Situation read → One template, three parameter sets.

What I'd do →

  1. Repo: charts/app/ plus envs/<env>/values.yaml and envs/<env>/config.json (env, namespace, autoSync).
  2. ApplicationSet with a git files generator on envs/*/config.json, goTemplate: true, missingkey=error.
  3. Template: name app-{{ .env }}, valueFiles: ["../../{{ .path.path }}/values.yaml"], destination namespace from config.
  4. templatePatch adds automated sync only when autoSync is true, so prod stays manual.

Why → Adding an environment becomes adding a folder; per-env differences stay in small files.

Interview tip → Mention templatePatch for conditional sync policy; it shows you know newer features.

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

More on Environments, ApplicationSets & Multi-Cluster