GitOps
An operational model that treats Git as the single source of truth for declarative infrastructure and apps, using automated controllers to continuously reconcile live cluster state
Table of Contents
Structure Diagram
What is GitOps?
An operational model that treats Git as the single source of truth for declarative infrastructure and apps, using automated controllers to continuously reconcile live cluster state. It is a core concept in Deployment Strategies within Cloud / DevOps.
Core Principles
GitOps is a pull-based operational model where the entire desired state of infrastructure and applications is stored declaratively in Git. Software agents running inside the target cluster continuously compare live state against Git and automatically reconcile any drift.
Unlike push-based pipelines, external CI runners never need cluster admin credentials. Every production change goes through a reviewed Pull Request, giving teams a complete Git audit trail and instant rollbacks via git revert.
Practical Takeaways
- Separate app source from config manifests: Keep deployment manifests in a dedicated config repository (or isolated structure) to avoid CI trigger loops and enforce strict production approval controls.
- Enable automated self-healing: Configure the GitOps controller to automatically revert out-of-band manual changes (
kubectl edit), eliminating configuration drift across environments. - Never commit plaintext secrets: Integrate External Secrets Operator, Sealed Secrets, or Mozilla SOPS so sensitive credentials stay outside Git while remaining declarative.
Notable Examples
- Argo CD: A CNCF graduated GitOps engine offering visual diffing, ApplicationSets for multi-cluster fleets, and automated sync policies.
- Flux CD: A modular set of Kubernetes-native controllers supporting Helm, Kustomize, and automated image tag updates.
- Regulated Enterprise Platforms: Uses Git PR approvals and signed commits to satisfy SOC2/ISO change-management audits automatically.