What is a GitOps workflow?


A GitOps workflow is a method of managing infrastructure and applications using Git repositories, configuration files, and CI/CD pipelines to ensure automation, consistency, and collaboration.

Three components of GitOps workflows

By defining infrastructure using configuration files, teams can deploy identical environments every time, eliminating inconsistencies and reducing risk. This approach enhances efficiency, collaboration, and stability, forming the foundation of the GitOps model.

As a software development framework, GitOps operates through three key components: infrastructure as code (IaC), merge requests (MRs), and continuous integration and continuous deployment (CI/CD).

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.

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.

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.

Frequently Asked Questions

50%+ of the Fortune 100 trust GitLab

Start shipping better software faster

See what your team can do with the intelligent

DevSecOps platform.