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

You want preview environments for every pull request on the app repo. How do you do it with Argo CD?

IntermediateScenarioEnvironments, ApplicationSets & Multi-Cluster
Answer

Situation read → Ephemeral environments driven by PRs.

What I'd do →

  1. CI builds an image tagged with the PR head SHA for PRs labelled preview.
  2. ApplicationSet with a pullRequest generator (GitHub, label filter preview), creating preview-{{ .number }} in namespace preview-{{ .number }}.
  3. Helm parameters set image.tag to {{ .head_sha }} and an ingress host like pr-{{ .number }}.preview.example.com.
  4. Automated sync with prune; when the PR closes the Application and namespace are deleted.

Why → The generator ties environment lifecycle to PR lifecycle with no manual cleanup.

Interview tip → Mention resource quotas on preview namespaces to control cost.

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

More on Environments, ApplicationSets & Multi-Cluster