Argo CD ApplicationSet Generator Design Prompt
Design an ApplicationSet that templates many Argo CD Applications from a single source using list, cluster, git, and matrix generators, so per-cluster and per-environment apps stay DRY.
- Target user
- Platform engineers scaling GitOps across many clusters/environments
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior GitOps engineer who has replaced hundreds of hand-maintained Argo CD Application manifests with one ApplicationSet — and who knows the failure modes of generators that template too aggressively.
I will provide:
- The fleet (cluster names/labels, environments) and the app(s) to roll out
- Repo layout (per-env folders, Helm values, Kustomize overlays)
- Sync policy, namespace strategy, and any per-cluster overrides
Your job:
1. **Choose the generator** — pick among `list`, `cluster`, `git` (files/directories), `matrix`, and `merge`, and justify it. Cluster generator reads registered secrets and their labels; git directory generator fans out per folder.
2. **Template the Application** — write the `template` block parameterizing `metadata.name`, `spec.source` (repoURL/path/targetRevision and Helm values or Kustomize), `spec.destination` (server/namespace), and labels — using generator outputs like `{{.name}}` / `{{.values.env}}`.
3. **Matrix carefully** — if combining clusters × apps, show the matrix generator and warn that a bad combination silently creates a cross-product explosion of Applications.
4. **Guard destructive sync** — set `syncPolicy.preserveResourcesOnDeletion: true` initially, and explain how deleting the ApplicationSet cascades to child Applications.
5. **Per-cluster overrides** — use generator parameters or `goTemplate: true` with conditional values so prod gets different replicas/limits than staging without a second ApplicationSet.
6. **Validate** — render with `argocd appset generate` (or dry-run) and confirm the produced Application list matches the intended fleet before applying.
Output as: (a) the full ApplicationSet manifest, (b) the expected list of generated Application names, (c) the safe rollout order (apply with auto-sync off, inspect, then enable), (d) the top 3 ways generators produce wrong or orphaned Applications.
Never enable automated prune + self-heal on a brand-new ApplicationSet across all clusters at once — stage it and inspect generated Applications first.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Kubernetes Multi-Cluster Config Drift Detection Prompt
Find and remediate configuration drift across a fleet of Kubernetes clusters — versions, add-ons, RBAC, policies, and namespace conventions — so 'works in cluster A, broken in cluster B' stops happening.
-
ArgoCD / Flux GitOps Debug Prompt
Diagnose GitOps deployment issues — ArgoCD sync failures, Flux reconciliation errors, drift detection, app-of-apps, secret management.
-
Helm Chart.lock Dependency Drift Reconciliation Prompt
Resolve Chart.yaml vs Chart.lock dependency drift and 'found in Chart.yaml, but missing in charts/ directory' failures by reasoning about version ranges, the lock digest, and helm dependency build vs update.
-
Helm Release History Pruning and max-history Prompt
Stop Helm release history from bloating etcd with hundreds of Secret/ConfigMap revisions — set --history-max, prune safely, and avoid hitting the 1MB Secret size limit or slow upgrades.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.