100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
DevOps

GitOps

IntermediateTechnique9.2K learners

GitOps is an operational model in which a Git repository serves as the single source of truth for the desired state of infrastructure and applications, with automated tooling continuously reconciling the live environment to match what's…

Definition

GitOps is an operational model in which a Git repository serves as the single source of truth for the desired state of infrastructure and applications, with automated tooling continuously reconciling the live environment to match what's declared in Git.

Overview

In a GitOps workflow, changes to infrastructure or application configuration are made by opening a pull request against a Git repository rather than running commands directly against a live environment. Once merged, an automated controller — commonly Argo CD or Flux in Kubernetes environments — detects the change and applies it, continuously comparing the actual running state against the declared state in Git and correcting any drift, including changes made outside the GitOps process. This pull-based reconciliation model differs from traditional CI/CD, where a pipeline pushes changes out to an environment; in GitOps, the cluster (or environment) pulls its desired state from Git on its own schedule, which improves auditability (every change has a corresponding commit and pull request) and makes rollback as simple as reverting a Git commit. GitOps is closely related to Infrastructure as Code (IaC) — it applies the same version-controlled, declarative philosophy specifically to the ongoing operational state of a system rather than just its initial provisioning. GitOps has become especially popular for managing Kubernetes deployments, often combined with deployment strategies like canary deployment or blue-green deployment to progressively roll out changes that are reconciled from Git.

Key Concepts

  • Git repository as the single source of truth for desired state
  • Pull-based reconciliation by an in-cluster or in-environment controller
  • Automatic drift detection and correction against the declared state
  • Full audit trail of changes through Git commit and pull-request history
  • Rollback achieved by reverting a Git commit
  • Commonly implemented with tools such as Argo CD or Flux on Kubernetes

Use Cases

Managing Kubernetes application and infrastructure deployments declaratively
Providing an auditable history of every production configuration change
Automatically correcting manual, out-of-band changes to an environment
Rolling back a bad deployment by reverting a Git commit
Coordinating progressive rollouts alongside canary or blue-green strategies

Frequently Asked Questions