GitOps for Infrastructure Prompt
Design a GitOps workflow that reconciles cloud and platform infrastructure (not just app manifests) from Git using Flux/Argo plus an IaC operator, with safe drift handling and promotion.
- Target user
- Platform engineers extending GitOps from apps to infrastructure
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a delivery architect who has run GitOps for both applications and underlying cloud infrastructure at scale. I will provide: - My current IaC (Terraform/Pulumi/Crossplane/CloudFormation) and where state lives - My GitOps controller (Argo CD or Flux) and cluster topology - Repo layout and branching model - Environments and how changes flow between them - Pain points (manual applies, drift, slow promotions, unclear ownership) Your job: 1. **Decide what "GitOps for infra" means here** — pure Kubernetes-native (Crossplane/Cluster API reconciled directly) vs operator-wrapped IaC (tf-controller/Flux, Atlantis, Argo + a runner). State the tradeoffs honestly; not all infra belongs in a reconcile loop. 2. **Repo topology** — config repo vs source repo split, per-environment directories vs branches, and where the rendered manifests live. Recommend one and justify it. Avoid environment branches if drift between them will rot. 3. **The reconcile loop for stateful infra** — how plan/apply maps onto continuous reconciliation, where approval gates live, and how to prevent the controller from auto-destroying expensive resources. Define `prune` and deletion-protection policy explicitly. 4. **Drift handling** — detect drift continuously, but decide per-resource whether to auto-correct, alert-only, or freeze. Show how to classify resources into these buckets. 5. **Secrets** — SOPS/sealed-secrets/External Secrets Operator. Keep plaintext out of Git; show how the controller decrypts at apply time. 6. **Promotion** — image/version/module promotion from dev → stage → prod via PRs (image automation, or a promotion bot). Show the exact PR-driven flow and required approvals. 7. **Safety rails** — health checks, sync waves/dependency ordering, automated rollback, and a "break glass" path when GitOps must be bypassed during an incident — and how you reconcile Git afterward. 8. **Observability** — surface reconcile status, last-applied revision, and drift in a dashboard the on-call can read. Output as: (a) recommended repo tree, (b) controller config (Flux Kustomization / Argo Application or ApplicationSet), (c) drift-policy table per resource class, (d) promotion PR workflow, (e) break-glass runbook. Bias toward: Git as the single source of truth, explicit deletion protection, and slow-and-reversible over fast-and-irreversible for stateful infra.
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
-
IaC Drift Detection & Reconciliation Prompt
Build a cross-tool strategy to detect and reconcile drift between declared IaC and live infrastructure — scheduled detection, classification of drift causes, and a safe path back to convergence without nuking out-of-band fixes.
-
Crossplane Composition Revision Rollout & Pinning Prompt
Roll out changes to a Crossplane Composition safely across many live claims — using CompositionRevisions, revision pinning, and automatic-vs-manual update policies so a bad composition change cannot ripple into every managed resource at once.
-
Ansible Pull Mode GitOps Bootstrap Prompt
Design an ansible-pull workflow where nodes self-converge from a Git repo on a schedule, including bootstrap, locking, and reporting.
-
Kustomize Overlays and Components Prompt
Design a maintainable Kustomize structure — base, environment overlays, reusable components, patches, and generators — that scales across clusters without YAML duplication or template sprawl.
More Infrastructure as Code prompts & error guides
Browse every Infrastructure as Code 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.