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

Your ApplicationSet controller deleted all apps for an environment when someone accidentally removed `envs/prod/config.json`. How do you prevent a repeat?

AdvancedScenarioEnvironments, ApplicationSets & Multi-Cluster
Answer

Situation read → Generator lost an element, controller deleted the app, finalizer cascaded.

What I'd do →

  1. Set syncPolicy.preserveResourcesOnDeletion: true on the ApplicationSet so workloads survive an Application deletion.
  2. Use applicationsSync: create-update for prod ApplicationSets so Applications are never deleted automatically.
  3. Protect envs/prod/** with CODEOWNERS and a CI check that fails when an environment file is deleted.
  4. Restore now by reverting the commit; the Application is recreated and adopts any surviving resources.

Why → The ApplicationSet controller faithfully reflects Git, including mistakes.

Interview tip → Name both settings; most candidates know only one.

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

More on Environments, ApplicationSets & Multi-Cluster