GitOps is a simple idea with big consequences: describe the desired state of your system in Git, and let an in-cluster controller continuously make reality match. Instead of a pipeline pushing changes into production, the cluster pulls the declared state and reconciles any drift.
Push vs pull delivery
In a classic push pipeline, CI has cluster credentials and runs kubectl apply. In GitOps, CI only writes to Git; a controller inside the cluster (Argo CD or Flux) watches Git and applies changes. That flips the trust boundary: no external system needs standing production credentials.
A minimal Argo CD Application
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: web, namespace: argocd }
spec:
source:
repoURL: https://github.com/acme/deploy.git
targetRevision: main
path: apps/web
destination: { server: https://kubernetes.default.svc, namespace: web }
syncPolicy:
automated: { prune: true, selfHeal: true }With selfHeal and prune enabled, a manual kubectl edit is reverted automatically, and resources deleted from Git are removed from the cluster. Your cluster can no longer silently drift from what is reviewed in Git.
What GitOps does not solve
- State and data: nobody GitOps a database - backups and DR are still real work
- Secrets: Git is for manifests; use SOPS or Sealed Secrets, never plaintext
- Bad architecture: GitOps makes the wrong design reproducible, not right
GitOps is a baseline, not a destination. It earns its keep the day something breaks - and fails you the day before, if nobody owns it.
Start with one namespace, wire secrets to a real store, and practice the failure drills (broken sync, deleted namespace) before you roll GitOps out company-wide.