How it works
The explanation, with examples you can run.
How it fits with CI
CI still builds, tests, scans and publishes the artifact. What changes is the last step. Instead of a CI job calling kubectl apply or a cloud API with production credentials, CI (or a person) updates a config repository: "the checkout service now runs image …@sha256:4f1e…". An agent such as Argo CD or Flux, running inside the cluster, watches that repository and applies the change.
# config repo: apps/checkout/production/kustomization.yaml (sketch)resources: - ../baseimages: - name: ghcr.io/my-org/checkout digest: sha256:4f1e0000000000000000000000000000000000000000000000000000000000aaPinning the image by digest keeps the "versioned and immutable" promise: the commit describes exactly what runs.
Why pull matters
With push-based deploys, the CI system needs credentials that can change production, and so does anything that can compromise CI. With pull, the agent already lives inside the environment and only needs read access to Git. Production credentials never leave it. It also works for clusters that CI can't reach directly, such as private networks or edge sites.
Reconciliation and drift
The agent doesn't just apply on change; it keeps comparing. If someone edits a Deployment by hand, the agent reports it as out of sync and, if self-healing is on, puts it back. That makes manual hot-fixes visible, which is mostly a good thing. For fields another controller owns, such as replica counts managed by an autoscaler, tell the agent to ignore them.
Promotion and rollback
Environments are usually directories or branches in the config repository (staging/, production/). Promoting is a pull request that copies the digest from staging to production, so review, approval and history come from Git. Rolling back is git revert. The agent rolls the environment back to the previous state, provided the database changes underneath were backward compatible.
Where it stops
GitOps describes Kubernetes-style declarative systems well. It doesn't run your database migrations, decide canary steps or manage secrets by itself: pair it with a progressive-delivery controller (Argo Rollouts, Flagger), a migration step, and encrypted or external secrets (Sealed Secrets, SOPS, External Secrets) instead of plain secrets in Git.
Check yourself
3 questions. Get them all right to finish this topic.
0 of 3 right so far. Get all three to finish this topic.