Topics Gitops What is a GitOps workflow?

What is a GitOps workflow?


Managing IT infrastructure can be challenging, but teams that use well-known software development practices, including version control, code review, and CI/CD pipelines, find the process more convenient. By using config files, the same infrastructure environment is deployed each time. Many teams know that this workflow increases efficiency, collaboration, and stability, but they may wonder what it means to adopt GitOps.

Three components of GitOps workflows

As a software development framework, GitOps has three main parts to its workflow, including infrastructure as code, merge requests, and CI/CD pipelines.

1. Infrastructure as code (IaC)

The first step in a GitOps workflow is defining all infrastructure as code. IaC automates the IT infrastructure provisioning by using configuration files. IaC is a DevOps practice that supports teams to version infrastructure to improve consistency across machines to reduce deployment friction. Infrastructure code undergoes a similar process as application code with touchpoints in continuous integration, version control, testing, and continuous deployment. Automation leads to more efficient development, increased consistency, and faster time to market.

Managing infrastructure has traditionally been a manual process involving large teams maintaining physical servers. Each machine often has its own configuration, leading to snowflake environments. With infrastructure as code, teams have increased visibility, consistency, stability, and scalability.

2. Merge requests (MRs)

Declarative tools, such as Kubernetes, enable config files to be version controlled by Git, an open source version control system that tracks code changes. Using a Git repository as the single source of truth for infrastructure definitions, GitOps benefits from a robust audit trail. The second aspect of GitOps workflows involve merge requests, which serve as the change function for infrastructure updates.

Teams collaborate in merge requests through code reviews, comments, and suggestions. A merge commits to the main branch and acts as an audit log. Built-in rollback features enable teams to revert to a desired state and explore innovative ways to approach difficult challenges. Merge requests facilitate experimentation and provide a safe way for team members to receive fast feedback from their peers and subject matter experts.

3. Continuous integration and continuous deployment (CI/CD)

GitOps automates infrastructure management using a Git workflow with effective continuous integration and continuous deployment. After code is merged to the main branch, the CI/CD pipeline initiates the change in the environment. Manual changes and human error can cause configuration drift and snowflake environments, but GitOps automation and continuous deployment overwrites them so the environment always deploys a consistent desired state.

What is GitOps?

Take GitLab for a spin

See what your team can do with a single platform for software delivery.

Get free trial
Headshots of three people

Have a question? We're here to help.

Talk to an expert