Advertisement
Advanced ArgoCD, Applications

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.

Save ArgoCD mock interview
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: 60
Real-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