Pcornel
Automation

GitOps

Cheat sheet · https://pcornel.dk/topic.php?topic=5481

Back to the Topic

Answer

GitOps uses a Git repository as the source of truth for declarative infrastructure and application configuration, with an agent like Argo CD or Flux continuously reconciling the live system to match it.

Remember

  • Change Git, not the live system.
  • The controller reconciles continuously.
  • Rollback is a Git revert.

First checks

  • argocd app list — Argo CD apps and sync status
  • flux get all -A — Flux resources
  • git log --oneline -5 -- <env path> — changes to environment

Verify in this order

PR → merge → agent pulls → reconcile → target

Where it usually breaks

Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.

→ GitOps · operational reference

LayerGitOps operational reference
Runtime/ownershipOpenGitOps principles / reconciliation controllers · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationgit rev-parse HEAD; inspect reconciler source revision/status; query target resource generation/status independently
Expected interpretationDesired state is declarative, versioned/immutable, pulled automatically and continuously reconciled; the reconciler revision and target observed state agree or expose a clear drift/error.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5481

Confirmation

Confirm action

Continue?