How To Approach Implementing GitOps in Your Delivery Pipeline

essidsolutions

GitOps provides an operating model on how to implement a software delivery pipeline. However, it is crucial to implement GitOps with a well-defined implementation strategy. Here, Chris Myers discusses how to approach a GitOps implementation effectively.

GitOps paves the way for integrating infrastructure management as a part of the software delivery pipeline. It is achieved by combining Git, Infrastructure as Code (IaC), and CI/CD tools. Moreover, GitOps provides an operating model on how to implement such a pipeline. However, the exact requirements and complexity will vary from pipeline to pipeline. Thus, it is crucial to implement GitOps with a well-defined implementation strategy. So, let’s see how to effectively approach a GitOps implementation to aid you in this matter.

Should We Use Dedicated Pipelines or Integrate to an Existing Pipeline?

First, you should decide whether to create a new pipeline dedicated to infrastructure changes or integrate them into an existing pipeline as a part of the overall delivery process. Creating a dedicated pipeline will be optimal for large-scale infrastructure management. It allows the incorporation of infrastructure resources like backup plans and firewall rules that are not directly dependent on the software development processes. Even in the case of an errored configuration, you can run a simple git revert to rolling backOpens a new window to the previous configuration without changing the commit flow.

Infrastructure changes must be integrated as a part of the software delivery pipeline in instances where infrastructure changes are tightly intervening with the development, such as provisioning new instances, deploying containers, storage buckets, and changing load balancer configurations. However, a hybrid approach will be the most optimal choice in many cases where all infrastructure is mapped using dedicated pipelines. There, infrastructure teams can manage infrastructure at the organizational scale and facilitate software-related infrastructure changes through the delivery pipeline. It offers the flexibility of integrating GitOps in the SDLC while providing greater control over the overall infrastructure independently of the software pipeline.

While a hybrid approach may be preferred, integrating into an existing pipeline will be sufficient for smaller teams with limited infrastructure resources or when GitOps is used for specific use cases like managing Kubernetes deployments.

Additionally, creating a dedicated pipeline offers a clean slate for the DevOps team. It even allows them to implement the infrastructure pipeline as they see fit without any constraints. On the other end, integrating GitOps into an existing pipeline may restrict how GitOps functionality can be integrated. Yet, as a pre-existing pipeline has already laid the groundwork of the CI/CD pipeline, you just need to add the GitOps stages to the pipeline and extend it without reinventing every aspect.

See More: Transform Your Software Development Strategy: Three Steps to Avoid DevOps Pitfalls

How To Choose the Right Software Stack

Typically, a software delivery pipeline is split into continuous integration (CI) and continuous delivery (CD). CI takes care of developing, building, testing, and integrating code, while CD is responsible for delivering software to the production environment. This scenario is exactly the same for infrastructure management. There, CI takes care of your IaC development and verification, while CD deals with applying those changes to your environment.

Selecting a proper repository is the first consideration of the software stack, as a proper Git repository is the core dependency of GitOps. Repository providers like GitHub evolve beyond a simple code respiratory to provide CI/CD capabilities via GitHub ActionsOpens a new window . It offers direct package storage and publish capabilities via GitHub Packages, etc., enabling it to facilitate the entire delivery pipeline through your repository. Using a single tool will undoubtedly provide a seamless user experience. On the opposite end of the spectrum, users can utilize different tools for different use cases. For example, for continuous integration, you can utilize an integrated service like GitHub Actions or dedicated tools like Jenkins with GitHub facilitating the repositories. At the same time, a dedicated CD tool like ArgoCD manages the deployments in a K8s cluster. It will provide more flexibility and options when creating the pipeline yet at the cost of added complexity while setting up and maintaining the pipelines. 

With the repository provider and CI/CD tools sorted, the next major consideration is the IaC tool. Their native IaC option can be an ideal choice if you specifically target a specific platform. However, it comes with the caveat of you being locked into their platform. A platform-agnostic IaC tool like Terraform, Pulumi will be beneficial to stop you from beginning vendor-locked while still providing near-native IaC capabilities across the supported platforms. There is a trend toward development kits that allow users to use their preferred programming languages to manage infrastructure without learning a domain-specific language. This trend provides users with more options on how to approach IaC.

Conclusion

GitOps is the way to manage infrastructure in a rapidly evolving software delivery landscape. Users can make informed decisions when implementing GitOps to a delivery pipeline by focusing on simple factors like pipeline strategy and the tool stack rather than chasing trends or blindly diving into GitOps. These decisions can then be translated into an overarching implementation and maintenance strategy to implement GitOps as part of your delivery pipeline easily.

What strategies do you have in place to implement GitOps effectively? Share with us on FacebookOpens a new window , TwitterOpens a new window , and LinkedInOpens a new window .

MORE ON SOFTWARE DELIVERY: