GitOps

GitOps is an operational pattern in which the desired state of infrastructure and applications is declared in a Git repository, and an automated controller continuously reconciles the running system toward that state. Git becomes the source of truth; deployments happen by merging pull requests, not by running ad-hoc commands.

Core principles

  • Declarative. The repo describes the desired state, not the steps to reach it.
  • Versioned and audited. Every change is a commit with an author, message, and history.
  • Pulled, not pushed. An agent inside the cluster pulls from Git and applies; CI does not need cluster credentials.
  • Continuously reconciled. Drift between Git and the live system is detected and corrected automatically.

How a pull request becomes a deploy

  1. Developer changes a Kubernetes manifest, Helm values, or Terraform file in a Git repo.
  2. CI runs tests and approvals; the change merges to the main branch.
  3. The GitOps agent (ArgoCD, Flux) notices the new commit and applies the manifests to the cluster.
  4. If anything drifts from Git, the agent re-converges the cluster.

Common tools

  • Kubernetes-native: ArgoCD, Flux, Argo Rollouts
  • Infrastructure: Atlantis, Terraform Cloud, Spacelift, env0
  • Multi-runtime: Werf, Devtron, Codefresh

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon