If you’re working in today’s IT world, you probably know about DevOps, but you may not be familiar with the more recent concept of GitOps. That’s ok; both the definition and practices of GitOps are still evolving. And, although GitOps is difficult to explain in a few words, the resources provided in this article will help you understand the basics.
What Is GitOps?
“At its most basic level, GitOps is a development approach that uses a code version control system, often Git, as the basis for defining and controlling a DevOps workflow and synchronization across systems,” says Sean Michael Kerner. And, Weaveworks says, “GitOps is our name for how we use developer tooling to drive operations.”
According to the GitOps Working Group, GitOps “builds and iterates on ideas drawn from DevOps and Infrastructure as Code that started with Martin Fowler’s comprehensive Continuous Integration overview and provides the freedom to choose the tools that you need for your specific use cases.”
The GitOps Working Group, which is part of the Cloud Native Computing Foundation (CNCF) Special Interest Group for App Delivery, has undertaken the task of clearly defining “a vendor-neutral, principle-led meaning of GitOps." These underlying principles are still a work in progress, but they are currently defined as follows:
- Declarative configuration: All resources managed through a GitOps process must be completely expressed declaratively.
- Version controlled, immutable storage: Declarative descriptions are stored in a repository that supports immutability, versioning and version history (for example, Git).
- Automated delivery: Delivery of the declarative descriptions, from the repository to runtime environment, is fully automated.
- Software agents: Reconcilers maintain system state and apply the resources described in the declarative configuration.
- Closed loop: Actions are performed on divergence between the version controlled declarative configuration and the actual state of the target system.
How Does GitOps Work?
In explaining how GitOps works in the real world, Weaveworks notes that Git is a part of every developer’s toolkit, and that their developers use a GitOps approach to operate Kubernetes via Git, for example. “We manage and monitor all of our applications and the whole ‘cloud native stack’ using GitOps. It feels natural and less intimidating to learn, and the tools themselves are very simple.”
“By using Git as our source of truth, we can operate almost everything,” Weaveworks says. “For example, version control, history, peer review, and rollback happen through Git without needing to poke around with tools like kubectl.”
Weaveworks also notes the importance of declarative configuration (one of the definitive principles of GitOps), whereby configuration is guaranteed by a set of facts rather than a set of instructions. “By using declarative tools, the entire set of configuration files can be version controlled in Git. And it also means you get code reviews, comments in the configuration files, and links to any issues in commit messages and PRs. All of this makes the system (and the reasons behind it!) discoverable and easier to operate, recover, and observe.”
The GitOps Working Group lists other benefits of a GitOps approach:
- Increased developer and operational productivity
- Enhanced developer experience
- Improved stability
- Higher reliability
- Consistency and standardization
- Stronger security guarantees
To learn more, check out the resources in this article as well as GitOps Con Europe, which is coming up May 3, 2021. This is a one-day virtual conference organized by the GitOps Working Group as part of KubeCon + CloudNativeCon Europe.