How do you create ephemeral preview environments with ArgoCD?
Short answer
Use the ApplicationSet Pull Request generator: it creates an Application for each open PR (parameterized by branch/PR number), deploying a preview environment, and deletes it when the PR closes.
Advertisement
AModel answer
Use the ApplicationSet Pull Request generator: it creates an Application for each open PR (parameterized by branch/PR number), deploying a preview environment, and deletes it when the PR closes. This gives reviewers a live environment per PR without manual setup, cleaned up automatically.
generators:
- pullRequest:
github:
owner: org
repo: web
requeueAfterSeconds: 60Real-world example
Every pull request spins up its own namespace/preview URL via the PR generator, torn down on merge or close.
Likely follow-ups
- How are preview envs cleaned up? | What parameters can you template from a PR?
Related topics