GitOps: Streamlining Operations with Code

DevOps

20 September 2023


Share :

| |

In recent years, with the wave of adoption of DevOps tools and practices, people have started talking about GitOps. The term is the result of merging the terms Git and Operations.

Let’s take a detailed look at what it is, what benefits can be derived from its adoption, and what challenges can be faced during its adoption.

What is GitOps

GitOps is, similarly to DevOps, a set of practices and tools used for applications that are also applied at the infrastructure level. It includes version control, Continuous Integration and Delivery flows, and automated security and compliance checks.

Through GitOps, it is possible to fully automate the creation of infrastructure, especially when it comes to cloud infrastructure. By using GitOps practices, human errors can be minimized, as manual interventions are reduced to a minimum.

How to Apply GitOps

In order to apply GitOps, at least the following DevOps practices must be used:

  • Infrastructure as Code: Infrastructure must be defined as code to make changes traceable and replicable.
  • Git Workflow Management: By having a well-defined Git workflow, collaboration can be facilitated through Pull Requests (also called Merge Requests), which allow code reviews before it is even used to generate new infrastructure resources.
  • CI/CD: It is critical that CI/CD workflows are used to ensure full automation of infrastructure releases as well as continuous execution of tests and security checks

Benefits of GitOps

Benefits experienced by companies that have used GitOps include:

  • Increased efficiency and speed in infrastructure creation
  • Reduced costs
  • Improved security

In addition, if systems for creating and orchestrating containers (such as Docker and Kubernetes) are used to release applications, a level of total infrastructure consistency and replicability is achieved.

GitOps also enables continuous monitoring of applications and infrastructure. Any unexpected changes or errors can be detected and corrected quickly, thanks to the version control system put in place by Git. If needed, a rollback to a previous version can be performed simply by restoring the state of the Git repository.

Regarding security, which is a key priority in application and infrastructure development, GitOps facilitates security policy management and regulatory compliance through the ability to perform reviews of changes made to code and configurations. In addition, GitOps’ pull-based change enforcement model means that only approved changes are brought into the production environment.

Challenges in Adopting GitOps

While it is true that the adoption of GitOps brings countless benefits, it is also true that it is not an easy process to implement for a variety of reasons.

For example, the GitOps approach requires that Git be used as a “single source of truth” to describe the state of an infrastructure. This approach may not be familiar to people with a systems background who have had little to do with code and versioning systems during their careers. This therefore involves a great deal of work needed to change the culture and mindset necessary to actually implement GitOps.

Another important aspect is that of configuration validation. Using Git actually allows you to implement several useful practices such as security and compliance checks on your code. However, it is necessary to take the proper time to thoroughly analyze and actually apply all these checks. This is because security checks can be done on multiple levels and code checks can include unit-testing, linting, and simulated executions via dry-run mode.

Another challenge is related to increasing the number of tools and integrations needed. Indeed, there are several tools designed to apply GitOps in one’s infrastructure. Among the main ones we would like to mention the following:

  • ArgoCD
  • FluxCD
  • Jenkins X
  • Werf

The introduction of new tools therefore requires prior analysis to understand their logic. GitOps tools are usually opinionated, so the analysis must be meticulously performed. Additional training is then required to use all chosen tools to their full potential.

Conclusions

GitOps represents a powerful methodology for simplifying and improving the development and deployment process. It presents some challenges in adoption, but its benefits are countless. As in any aspect of IT, it therefore remains to carefully evaluate one’s use case and assess whether adopting GitOps can help in the ongoing journey of improving the systems development and maintenance experience.