GitOps: A Comprehensive Introduction‍

Khalil Kasmi
HeyJobs Tech
Published in
3 min readJun 13, 2022

Cloud-native adoption within enterprises continues to accelerate. With emerging technologies like Kubernetes, Prometheus, and Fluentd being commonly used, DevOps and IT professionals must adapt accordingly. On top of that, the rapid pace of digital transformation demands new ways of working that are agile, collaborative, and DevOps-driven. Instead of focusing on one technology or another as a “silver bullet” for your company’s unique challenges, adopting a “GitOps” approach can help you adapt to these new requirements with ease. In this blog post, we’ll introduce you to GitOps principles and how they can be applied in your organization today.

What is GitOps?

GitOps is an extension of the “Git” workflow that is applied to an entire organization’s production environments. It’s an approach to DevOps that doesn’t just operate on source code repositories, but on the entire IT landscape. GitOps uses centralized control over the entire lifecycle of infrastructure — including the software-defined network, storage, security, and even applications. The result is a consistent and standardized way of managing and governing everything IT, regardless of where it’s located. You’ll also use a common version control system that all stakeholders can access. This approach helps avoid potential issues that can arise from having multiple tools.

The GitOps approach can help us solve all these problems and more that simply cannot be solved using “Infrastructure as Code”. For example:

  • Implicit infrastructure, its state, and configuration. Sometimes you need to do a thorough investigation to find out where and how your application runs.
  • Missing changes in history. It can be even harder to find out how some applications were originally developed and who now manages them.
  • Security holes in environments. Created to facilitate administrative access to continuous delivery tools, these gaps make development fast and convenient but expose both applications and their users to risk.
  • Difficulties of disaster recovery. In manual/semi-manual processes, disaster recovery requires a strategy, which is not always the case.
  • Possible consistency in configuration. Even when a centralized configuration is used, the actual configuration and the specified configuration may differ in manual processes.

Why use GitOps?

There are many advantages to adopting GitOps practices. Some of the most common reasons to consider this approach include:

Centralized control

Giving teams the ability to collaborate and have a say in their environment, while also ensuring that all changes are properly documented and subject to change control.

Automation

Reducing the burden of manual tasks and human error by using software and tools to automate common processes. This frees up more time for strategic work, while also avoiding the potential for errors.

Consistency

Providing a consistent, standard method for managing and governing your organization’s production environments. This ensures that everything is configured in accordance with your organization’s standards, best practices, and security requirements.

How is GitOps applied?

There isn’t a one-size-fits-all solution to GitOps. Rather, it’s an approach that you can customize to fit the needs of your organization. The main goal of implementing a GitOps approach is to create a centralized source of truth for both the state of your IT landscape and the changes that are being made to it. This requires the creation of two key components:

The shared elements: All the components that are used across the entire lifecycle of IT — like the centralized logging and monitoring solution.

The individual environments: These are the unique environments that are used in the lifecycle of each application. For example, the staging environment and production environment that are used in the application delivery process.

Key takeaway

GitOps is an extension of the Git workflow applied to an entire organization’s production environments. It’s an approach to DevOps that doesn’t just operate on source code repositories, but on the entire IT landscape. When adopting a GitOps approach, you’ll enjoy several benefits, including consistency, visibility, collaboration, and traceability. This approach also helps reduce the risk of human error and results in more reliable outcomes.

How to do it? Easy — it’s just three steps:

  • Create an infrastructure representation in Git
  • Start to automatically sync infrastructure with its representation
  • Utilize tools like Atlantis, Terragrunt …

Links and resources

--

--