Theory
Theory: Desired State Lives in Git; the Cluster Converges
GitOps’s four pillars: Git as source of truth, declarative desired state, pull-based agents, continuous reconciliation. Push-based CI (kubectl apply from a pipeline) is CIOps, not GitOps.
Invariants
- If it is not in Git, it is drift.
- The agent, not the human, writes to the cluster API.
- Preview environments are extra desired states (extra Git refs or folders).
Git desired --pull--> reconciler --apply--> cluster actual
compare + converge
What can break
- Manual
kubectlon a GitOps cluster (the next reconcile fights you).
How to read this chapter
Pain, pillars, benefits, push vs pull, env repos, trunk vs PRs, vs other *Ops, when.