Sitemap

Introduction to GitOps

4 min readJan 23, 2024

--

As the world of infrastructure and software evolves, the concepts of continuous integration and deployment are gaining in maturity, encouraging the emergence of new approaches to keep up with the trend, including the “GitOps” approach.

This article will give you a glimpse into this rich, happy world!

What is GitOps?

The term GitOps was first introduced in 2017 by WeaveWorks:

  • Git: a deployment and version control tool used primarily in software development in a context of sharing and collaboration between developers.
  • Ops: presents IT operations i.e. operations, deployment, monitoring etc.

The GitOps approach is the convergence of the infrastructure-as-code (IaC) concept and CI/CD technologies. In fact, it’s an implementation technique that enables continuous deployment of cloud-native applications, thanks to the fusion of “Git” and automated operations stemming from the DevOps philosophy. It is the perfect answer to the emergence of modern infrastructures such as Kubernetes, serverless, microservices and cloud services.

In other words, the concept of GitOps is to have a Git repository containing a declarative description of the desired infrastructure in an environment (test, development or production), known as the “source of truth”, and an automated process for applying the infrastructure state defined in Git. As a result, any modification requires a Git repository update, and the automation process then takes care of the rest.

  • Pull: This strategy is more appropriate on the security side, thanks to the operator concept. The operator is an element that sits between the pipeline and the provisioning tool, whose role is to systematically compare the state of the infrastructure with the desired state declared in the repository, and make the necessary modifications when they are detected. Generally, it’s a Kubernetes Operator who takes charge of making pull requests and bringing the cluster into line with the request.
  • From a more detailed point of view, when deploying a new version of an application, the build pipeline ends with the modification of the environment by updating the application version after testing. The operator then detects a discrepancy between the git repo and the environment, applies a patch to eliminate the discrepancy and searches for the registry image to deploy.
  • If manual modifications have been made, the operator brings the infrastructure back into line with that described in git. In this way, he is assured that no manual intervention has been made and that the infrastructure remains controllable via Git. This is a significant advantage over the push model.

This strategy can be applied by specific GitOps tools such as ArgoCD or fluxCD.

The benefits of GitOps

Multiple and diverse reasons and favors are today leading companies to begin the GitOps approach and practice its principles.

  • Continuous application deployment
  • Traceability of the entire modification history of each environment, which is shared with the entire team.
  • Auto-documentation of infrastructure status and evolution on Git with commit messages.
  • Simple rollback with a git revert on the last commit thanks to the history.
  • Deployment security, since all modifications can be controlled via Git. In a pull model, deployment in the cluster is only authorized to the operator. Devops don’t need to access the cluster directly, which reduces the cluster’s attack surface.
  • Knowledge sharing and improved code quality in favor of peer programming and code review enabling double-checking of changes to minimize human error.
  • Ability to easily determine the gap between different environments (two branches or two commits) with a simple Git diff.

ArgoCD: a GitOps tool for deployment on Kubernetes

If you’re a GitOps enthusiast, you’ve probably already heard of ArgoCD. It’s an open-source tool that deploys on a Kubernetes cluster and enables continuous deployment of applications on Kubernetes, with a graphical look and feel that lets you monitor the application and its lifecycle.

Get KLANIK’s stories in your inbox

Join Medium for free to get updates from this writer.

ArgoCD follows the GitOps pattern, relying on “git” as a source of truth from different environments (test, development, production) to declaratively define the desired application state.

The tool supports several formats: Kustomize, Helm, Ksonnet, Jsonnet, YAML and JSON.

GitOps vs DevOps?

GitOps and DevOps are excellent modern approaches to IT development and deployment. Although they share the same principles of automation and continuous delivery, the two notions are absolutely far from being the same.

In the broadest sense, Gitops is a technique used to implement continuous infrastructure integration, version control and application deployment using a particular tool, namely “Git”.

On the other hand, Devops refers to a mindset, culture and philosophy that breaks down silos and promotes automation and collaboration between software developers and IT operations professionals for rapid continuous delivery and improved user experience.

Conclusion

Now it’s your turn to experiment with GitOps within your teams. This will be a great opportunity to judge its relevance, its contributions and perhaps its limitations.

GitOps is becoming a real must-have these days!

This article is brought to you by Oumaima JERBI | Consultant at KLANIK

--

--

KLANIK
KLANIK

Written by KLANIK

KLANIK is a consulting company specialized in IT Engineering which accompanies its partners in their digital and technological projects.