Bookmarks

GitOps

An approach to infrastructure management in which a Git repository serves as the source of truth for the desired state, and an agent automatically brings the system to that state.

checked 8 Nov

All terms

GitOps brings familiar development practices into operations: the system state is described declaratively and stored in Git, changes go through code review, and a dedicated agent continuously compares the actual state with the recorded one and reconciles any differences. The result is reproducible environments, a clear audit trail and rollback with a revert commit.

The four OpenGitOps principles

  • The desired state is described declaratively — as files that can be stored and versioned.
  • This state is immutable: a new version means a new commit, not edits made on top of the live one.
  • The agent pulls the desired state from the repository itself rather than having the CI pipeline push it.
  • The agent continuously compares the desired state with the actual one and corrects any differences.

How it works in Kubernetes

Application and infrastructure manifests live in a repository. A developer proposes a change in a pull request; after review and merge the commit lands in the main branch, and then the agent takes over:

  • the agent notices the new commit (or is notified by the repository webhook);
  • compares the manifests with what is actually running in the cluster;
  • applies what is missing — new image versions, settings, resources;
  • if someone has changed an object in the cluster bypassing the repository, the agent restores the state from Git.

Popular Kubernetes agents — Argo CD and Flux — work this way. A deployment comes down to changing a single field in the repository, for example an image tag from 1.4.2 to 1.5.0, and a rollback is a revert commit. Who changed the environment and when is visible in the Git history.

Who it is for

The approach grew up around Kubernetes, where declarative manifests are native, and that is where it is most widespread. But the principle applies more broadly: a repository can describe cloud infrastructure as code as well as the configuration of other systems — all that matters is that the state is declarative and the agent can reconcile and apply it.

Sources

the term is written from these pages

Verified 8 Nov

Not to be confused with

what it is mixed up with and how it differs

In depth in the references

where the topic is covered in detail