GitOps Overview

#GitOps #Infra #DevOps #Concepts

1. Definition

  • GitOps is a methodology for managing Operations through Git
  • The desired state of all infrastructure/applications is declaratively defined in Git
  • Controllers like Argo CD and Flux continuously synchronize (reconcile) Git with the actual environment

2. Background and Motivation

  • Limitations of traditional IaC (Terraform, etc.) + CI/CD approaches:
    • Drift problem: The actual environment diverges from Git
    • No audit trail for operational changes: Direct modifications via console/CLI → not recorded in Git
    • Environment inconsistency: Dev/staging/production can fall out of sync
  • GitOps addresses these issues by introducing the Git = Single Source of Truth principle

3. Core Concepts

  1. Declarative Configuration
    • Desired state is defined using YAML, Helm, Kustomize, etc.
  2. Git as the Single Source of Truth
    • Changes must only be applied through PRs/Commits
  3. Automatic Synchronization
    • The controller continuously compares Git with the actual environment → automatically reverts any drift
  4. Auditability and Transparency
    • All changes are traceable through Git history

4. CI/CD vs. GitOps

CategoryCI/CDGitOps
Deployment actorPipeline pushes to the environmentController pulls from Git
Execution modelEvent-triggered → one-shot executionContinuous monitoring & synchronization
Drift handlingUnknown; manual recovery requiredAutomatic recovery (reconciliation)
Change pathCI/CD + direct modifications allowedOnly Git PR/Commit permitted

5. Tech Stack

  • Git repositories: GitHub, GitLab, Bitbucket
  • CI: GitHub Actions, Jenkins, GitLab CI (build/test/image creation)
  • GitOps controllers (CD): Argo CD, Flux
  • Declarative deployment: Helm, Kustomize
  • Supporting tools: Sealed Secrets, Vault (secrets management), Kyverno/OPA (policy), Prometheus + Grafana (monitoring)

6. One-Line Summary

  • CI/CD: Automation that “pushes” code changes into the environment
  • GitOps: An operational pattern that treats Git as the single source of truth for operations, keeping the environment always in sync with the Git state
https://www.samsungsds.com/kr/insights/gitops.html
Loading...