Generators include: List (static values), Cluster (per registered cluster), Git (per directory or from a config file in Git), Matrix (combine two generators), Merge (overlay generators), SCM Provider (per repo in an org), and Pull Request (per open PR, great for preview environments). You pick based on whether apps vary by cluster, directory, repo, or PR.
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?
ignoreDifferences tells ArgoCD to disregard specified fields when computing diffs, so the app doesn't show OutOfSync due to values mutated by controllers (e.g., replica counts set by HPA, or webhook-injected fields). You target fields by group/kind and JSON pointers or jq/JSONPath, preventing false drift and sync fights.
ArgoCD labels/annotates managed resources with a tracking id (by default the label app.kubernetes.io/instance, or an annotation for the newer tracking method). This lets it know which live resources an Application owns, compute diffs, and prune orphans. The tracking method is configurable to avoid clashes with other tools using the same label.
An AppProject groups Applications and enforces guardrails: which source repos are allowed, which destination clusters/namespaces apps can deploy to, and which resource kinds are permitted (allow/deny lists). Projects provide multi-tenancy boundaries and are the basis for scoping RBAC, limiting blast radius per team.
Common approaches: a Kustomize base with per-env overlays, or a Helm chart with per-env values files, each referenced by a separate Application (often generated by an ApplicationSet Git generator). Promotion moves a tested revision/tag from one env's config to the next via PR, keeping environments consistent yet independently controllable.
The argocd CLI manages apps: `argocd app list`, `argocd app get <name>`, `argocd app sync <name>`, `argocd app diff <name>`, `argocd app history`, and `argocd app rollback`. It's used for automation and troubleshooting alongside the web UI and the declarative Application CRs.
Newer ArgoCD supports multiple sources in one Application, letting you combine, for example, a Helm chart from one repo with values from another repo, or reference resources across repos. This decouples chart source from environment config and supports patterns like using a shared chart with team-owned values.
Use sync-options annotations: `Prune=false` stops deletion, and for out-of-band or one-time resources you can annotate to skip dry-run or apply behavior. For resources you want created if absent but not overwritten, options like `Replace=false` and selective ignoreDifferences help. This balances declarative ownership with pragmatic exceptions.
Check `argocd app get` for resource-level status and messages, view the diff to see what's out of sync, inspect events and pod/controller logs, verify health checks (custom resources may need Lua health scripts), and confirm no sync hooks or waves are blocking. Common causes: failing readiness probes, missing CRDs, RBAC denials, or resources mutated outside Git.