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 →
- CI builds an image tagged with the PR head SHA for PRs labelled
preview. - ApplicationSet with a
pullRequestgenerator (GitHub, label filterpreview), creatingpreview-{{ .number }}in namespacepreview-{{ .number }}. - Helm parameters set
image.tagto{{ .head_sha }}and an ingress host likepr-{{ .number }}.preview.example.com. - 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.
More on 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.IntermediateA new prod cluster comes online every month. How do you make sure it gets all standard add-ons automatically?IntermediateA matrix ApplicationSet (clusters times apps) generated 300 Applications, but a bad commit to one app's chart broke all prod clusters at once. How do you redesign for safer rollouts?AdvancedSome clusters need a different version of an add-on than the rest. How do you handle exceptions without duplicating ApplicationSets?AdvancedHow would you register 50 EKS clusters with Argo CD securely, without long-lived tokens?AdvancedA product team wants their own namespace in every cluster with the same RBAC and quotas. How do you automate it?Intermediate