Narration transcript

AI-narrated article. Prose is preserved with pronunciation adjustments; code and image cues refer to the written article.

Read the original article

Bootstrapping Kubernetes Clusters with Terraform and Argo CD: A Durable Two-Layer Approach

This is the AI-narrated article. The prose follows the written post; pronunciation is adjusted, and code and images are announced separately.

Robust cluster bootstrap separates infrastructure provisioning from continuous reconciliation. This guide details a production-grade Terraform plus Argo CD model with explicit governance.

TL;DR

A production-ready Kubernetes bootstrap is more reliable when Terraform and Argo CD have explicit responsibilities. Terraform should provision and manage infrastructure primitives, cluster lifecycle resources, and state safety controls. Argo CD should continuously reconcile platform and workload resources from Git using declarative application definitions. This model reduces drift and clarifies incident ownership. Teams should harden Terraform workflows with plan review and state management controls, and treat Argo CD app-of-apps repositories as privileged automation surfaces with strict access and project boundaries.

Image. Argo CD app-of-apps architecture diagram.

App-of-apps accelerates bootstrap, but should be managed as privileged automation.

Bootstrapping Fails Most Often at Ownership Boundaries, Not Tooling

Teams rarely fail because Terraform or Argo CD is incapable. They fail because lifecycle ownership is mixed: infrastructure and runtime reconciliation are managed by overlapping processes with unclear authority.

A reliable model is to enforce two layers:

Terraform manages infrastructure lifecycle and state-critical primitives.

Argo CD manages continuous reconciliation of Kubernetes resources from Git.

This aligns with Argo CD’s cluster bootstrapping guidance and reduces operational ambiguity during upgrades and incidents.

1. Use Terraform for Infrastructure Lifecycle and State Discipline

Terraform should own cluster-adjacent infrastructure and provider-backed lifecycle resources.

Code example. Refer to the written article for the complete code.

Code example. Refer to the written article for the complete code.

Use plan review before apply and maintain dependency lock artifacts for reproducibility.

2. Use Argo CD for Continuous Platform and Workload Reconciliation

After control plane and baseline nodes are ready, Argo CD should take over in-cluster reconciliation from Git.

Code example. Refer to the written article for the complete code.

This keeps application drift control where it belongs and avoids re-running infrastructure provisioning for routine app-level changes.

3. Treat App-of-Apps as Privileged Infrastructure

Argo CD documentation frames app-of-apps as admin-level capability. That is a governance requirement, not a suggestion.

Practical controls:

restrict write access to parent app repositories

enforce review gates on project field and destination scope

define clear project boundaries for child applications

use sync waves where ordering dependencies exist

Without this, app-of-apps can become an uncontrolled cross-namespace mutation channel.

4. Keep Rollout and Recovery Paths Explicit

This model improves recoverability only when rollback and ownership boundaries are practiced:

Terraform rollback path for infrastructure-level failures

Argo CD sync and app-level rollback path for runtime config failures

If rollback paths are mixed, incident response slows and attribution becomes unclear.

5. Why This Model Holds Up Better Than Mixed Bootstrap Flows

Table. Columns: Dimension, Mixed Ownership Bootstrap, Two-Layer Terraform + Argo CD, Operational Benefit.

Row 1. Dimension: Source of truth; Mixed Ownership Bootstrap: Ambiguous across tools and scripts; Two-Layer Terraform + Argo CD: Clear split: infra in Terraform, runtime in Argo CD; Operational Benefit: Faster root-cause isolation.

Row 2. Dimension: Drift control; Mixed Ownership Bootstrap: Partial and inconsistent; Two-Layer Terraform + Argo CD: Layered and scoped; Operational Benefit: Better change confidence.

Row 3. Dimension: Access governance; Mixed Ownership Bootstrap: Broad write permissions accumulate; Two-Layer Terraform + Argo CD: Privileged app-of-apps repos controlled explicitly; Operational Benefit: Lower privilege-escalation risk.

Row 4. Dimension: Rollback design; Mixed Ownership Bootstrap: Ad hoc and incident-specific; Two-Layer Terraform + Argo CD: Defined per layer; Operational Benefit: Shorter recovery cycles.

Row 5. Dimension: Team collaboration; Mixed Ownership Bootstrap: Ownership conflicts during change windows; Two-Layer Terraform + Argo CD: Stable boundaries for platform and app teams; Operational Benefit: Reduced coordination overhead.

End of table.

What To Do Next

Document ownership boundaries before changing bootstrap code.

Enforce Terraform plan-review-apply workflow with remote state controls.

Restrict app-of-apps parent repository writes and validate project scope in PRs.

Apply sync-wave ordering for foundational components and dependent apps.

Frequently Asked Questions

Q: Can Argo CD replace Terraform for full bootstrap? Argo CD is excellent for Kubernetes resource reconciliation, but provider-backed infrastructure lifecycle and state concerns are better handled by Terraform in most environments.

Q: Is app-of-apps required for Argo CD bootstrap? No, but it is common. If adopted, it should be treated as privileged automation.

Q: Should auto-sync be enabled on everything immediately? Not always. Use automated sync intentionally with clear prune behavior, ordering strategy, and rollback expectations.

Resources

Argo CD Cluster Bootstrapping

Argo CD Declarative Setup

Argo CD Getting Started

Argo CD Application Specification

Argo CD Automated Sync

Argo CD Sync Waves

Argo CD App Create Command

Terraform Apply

Terraform S3 Backend

Terraform Provider Requirements

Terraform Dependency Lock

Terraform AWS EKS Cluster

Terraform AWS EKS Node Group

Audio library