GitOps
Operational model in which a Git repository holds the declared state of infrastructure and applications, and automated agents keep systems in sync with it.
GitOps applies the workflow of software development to operations. The desired state of a system, such as which application versions run in a cluster and how they are configured, is written declaratively and stored in a Git repository. Changes are made by committing to that repository, usually through reviewed pull requests, rather than by running commands against live systems. Automated software then compares the running system with the repository and corrects any difference, so that the repository becomes the single source of truth for what should be deployed.
The term was coined in 2017 by the company Weaveworks, which developed the Flux tool. Argo CD, open-sourced by Intuit, is another widely used implementation; both became Cloud Native Computing Foundation projects. An industry working group later summarized the approach in four principles: the system is described declaratively, its desired state is versioned and immutable, approved changes are pulled automatically and software agents continuously reconcile actual state with desired state. Most GitOps tooling targets Kubernetes, whose declarative resource model suits the approach, though the ideas apply to other platforms.
GitOps builds on infrastructure as code and continuous delivery, adding the pull-based reconciliation loop. Because agents inside the environment fetch changes, external build systems need fewer credentials for production, which can reduce exposure. The Git history doubles as an audit log, and rolling back can be as simple as reverting a commit. Limitations include the difficulty of managing secrets in a repository, the need to handle changes that are not easily expressed declaratively, such as database migrations, and the sprawl that can arise when many environments are described in many repositories.
Key points
- In GitOps, a Git repository is the source of truth for what should run in production.
- Agents inside the environment pull approved changes and continuously correct drift.
- Weaveworks coined the term in 2017; Flux and Argo CD are widely used implementations.
- Git history provides an audit trail, and reverting a commit can roll back a deployment.
Related entries
Git
Free and open-source distributed version control system created by Linus Torvalds in 2005, used to track changes in source code.
Kubernetes
Open-source system for automating deployment, scaling and management of containerized applications across clusters of machines.
Infrastructure as Code
Practice of defining and provisioning servers, networks and other infrastructure through machine-readable files rather than manual configuration.
Continuous Delivery
Software engineering approach in which every change is built, tested and prepared so that it can be released to production safely at any time.
CI/CD Pipeline
Automated sequence of stages that builds, tests and releases software changes, combining continuous integration with continuous delivery or deployment.
Version Control
System that records changes to files over time so that people can track history, revert mistakes and collaborate on the same codebase.
Cloud Native Computing Foundation
Linux Foundation organization that hosts Kubernetes and other cloud native open-source projects and promotes their adoption.
Featured in guides
Referenced by
Other entries that discuss or point to GitOps.