GitOps (original) (raw)

What is GitOps?

GitOps is an operational framework that applies DevOps practices, such as continuous integration/continuous delivery (CI/CD) and version control, to infrastructure automation.

GitOps can be used by teams that often work with Kubernetes and want to start moving toward continuous operating models, such as CI, deployment or testing.

How GitOps works

GitOps uses a Git repository as a single source of truth to deliver infrastructure as code (IaC). Code changes are tracked, which provides version control if a rollback is needed. Once declared in Git, a GitOps agent is used to apply all code configurations automatically in development, test, staging and production environments.

GitOps is based around the idea of pull requests. Once a pull request is initialized, the user can see an overview of changes in each branch in a repository base. The user can then add a summary of proposed changes, review changes, add labels and mention other contributors. After the pull request is created, a commit from a topic branch can be added where contributors can view any proposed changes. Once everyone approves the request, the changes are merged with the pull request.

Changes to an application or cluster could include updates to container images, fixes to errors in the environment or updates to specifications. Troubleshooting with GitOps is fast, as users can fix any issues that appear with a pull request rather than in the underlying system.

GitOps works with any CI and Git server. It can also use other tools for Git pushes, development and continuous integration. Jenkins X, for example, is an open source tool that works with GitOps to provide CI/CD as well as other automated testing tools designed for cloud-native applications -- specifically in a Kubernetes environment. Other tools, including Bitbucket, GitHub and Amazon Web Services CodeDeploy, can be used in GitOps as well.

The GitOps pipeline

GitOps works using CI and CD to ensure a continuous development workflow within Kubernetes.

Core components of GitOps

GitOps requires a range of core components, including the following three processes:

GitOps includes the following core tool or service components:

Uses of GitOps

GitOps can be used for several applications; for example, teams might use it to implement continuous deployment for Kubernetes. Besides enabling an organization to push applications out more quickly, continuous deployment removes the need for any individual deployment management systems.

GitOps can also be used to implement continuous delivery for Kubernetes. Continuous delivery typically enables development teams to build, test and deploy software at a fast pace through incremental updates. Continuous delivery for Kubernetes also enables a continuous integration and runtime pipeline, which should be able to read and write files to Git, update container repositories and load container images.

GitOps also lets an organization use a single tool for controlling infrastructure, enabling version control for changes in configuration files and constant monitoring of changes and send alerts.

GitOps benefits

The underlying Git protocol isn't resource-intensive and is open source. It offers the following additional benefits:

GitOps disadvantages

Some disadvantages of GitOps, however, include these drawbacks:

GitOps vs. DevOps

GitOps and DevOps are similar sounding portmanteaus, which have equally important similarities and differences.

DevOps is a combination of the words development and operations. It's a collaborative approach to tasks performed by an organization's application development and IT operations teams. Some of the main goals of DevOps are to promote collaboration between development and operations teams and to adopt programmable software development, automation and infrastructure deployment practices.

GitOps is a subset or extension of DevOps that specifically uses the Git tool. One of the main goals of GitOps is to automate the development process and speed up release cadences, which is a shared goal of DevOps. However, GitOps is a paradigm or technique, whereas DevOps is more of a culture or philosophy. GitOps is tied to the use of Git and Kubernetes, whereas DevOps isn't tied to any single tool.

Future of GitOps

Some believe GitOps could be the future of DevOps, as it's both a declarative and a cloud-native approach to configuration management. GitOps is useful in situations when using version control to manage infrastructure and application deployment would otherwise be difficult. GitOps is also useful for continuous deployment automation and for managing hybrid cloud architecture.

A GitOps workflow is helpful for managing modern cloud infrastructure. The operational framework is structured around and based on Kubernetes cluster management. GitOps continues to grow, though, as GitOps software is being developed to function on non-Kubernetes systems.

However, GitOps might not be the right fit for everyone, as not every organization views itself as being reliant on a single tool -- or even just using Git pull requests -- as the most optimal workflow for its infrastructures.

GitOps might not outgrow DevOps, but the methodologies continue to be refined and redefined over time.

Learn how to evaluate GitOps models and how GitOps compares to other development practices.

This was last updated in May 2023

Continue Reading About GitOps

Dig Deeper on Systems automation and orchestration