Definition of GitOps according to OpenGitOps
GitOps is, according to the OpenGitOps project, “a set of principles for operating and managing software systems”. These principles concern a specific object: the desired state of the system, that is, the set of configuration data sufficient to recreate it. The name comes from Git, the version control tool that the project’s glossary gives as the canonical example of storage for this state.
OpenGitOps is overseen by the GitOps Working Group, which its website presents as a working group of the CNCF (Cloud Native Computing Foundation) SIG App Delivery. The website assigns it a goal: to give GitOps a principle-led and vendor-neutral meaning. The principles are published in a version 1.0.0, with a glossary that the project has translated into French.
The four published principles
The desired state of a system managed with GitOps must be:
- Declarative. The configuration describes the intended operating state, without specifying the procedures that lead to it.
- Versioned and immutable. It is stored in a way that enforces immutability, versioning and a complete history.
- Pulled automatically. Software agents themselves pull the desired state declarations from the source.
- Continuously reconciled. Agents continuously observe the actual state of the system and attempt to apply the desired state.
The glossary clarifies two terms. “Continuous” does not mean instantaneous. Drift refers to the actual state moving away from the desired state. Reconciliation is triggered by any divergence, whether it comes from drift or from a new declaration.
What the reconciliation loop changes in operations
In this model, changing production means changing a declaration in the repository. Three effects follow.
- The change goes through the repository’s mechanisms: proposal, review, merge. According to the glossary, state storage must control access and record changes.
- The version history shows who changed what and when. Rolling back consists of restoring an earlier version of the declaration.
- A change made by hand on the system is drift, which the agent detects.
The glossary also sets a limit. The desired state generally does not include the application’s persistent data, such as the contents of a database. GitOps makes it possible to recreate a configuration; data backup remains a separate subject.
GitOps, infrastructure as code, CI/CD, DevOps: not to be confused
Infrastructure as code describes an infrastructure in versioned files. GitOps adds pulling by agents and continuous reconciliation.
In a traditional CI/CD pipeline, according to the OpenGitOps glossary, automation is generally driven by predefined triggers, whereas reconciliation is triggered by every divergence. The two can be combined: the pipeline builds and tests an artefact, then updates the declaration, which the agent applies.
DevOps is a way of working that brings development and operations closer together. The OpenGitOps website presents GitOps as an extension of ideas from DevOps and infrastructure as code.
Nor is GitOps to be confused with a tool. Open source tools such as Argo CD and Flux play the role of agent for Kubernetes.
Example: a version upgrade, then a manual tweak
Take a team operating an invoicing service on a Kubernetes cluster. To move to a new version, a developer changes the version number in the declaration file and proposes the change in the Git repository. A colleague reviews it, then merges it. The agent installed in the cluster notices the gap with the actual state and deploys the new version.
A few days later, an administrator manually increases the number of instances to absorb a peak in load. The agent sees this as drift. Depending on the configured policy, it restores the declared state or alerts the team. For the setting to stick, it must be carried over into the repository.
The choice of repositories, agents and review rules fits into the delivery pipeline and internal platform described in our page DevOps and platform engineering.