GitOps — Explained with Examples
GitOps is a DevOps methodology that uses a Git repository as the single source of truth for declarative infrastructure and application configurations. A software operator (agent) continuously reconciles the actual state of the system with the desired state described in Git.
When you want to change infrastructure or deploy a new version, you open a pull request against the Git repository. Once merged, the GitOps agent — tools like ArgoCD or Flux — detects the drift and automatically applies the changes to the target environment. This means you get version control, audit trails, code reviews, and rollbacks — all using standard Git workflows.
Real-world analogy. GitOps is like having a house thermostat connected to a written schedule. You post the schedule on the wall (Git). A robot reads the wall every minute and adjusts the temperature to match. If you want it warmer, you update the schedule. The robot never asks for permission — it just follows the wall.
Example (ArgoCD Application):
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
spec:
source:
repoURL: https://github.com/org/repo.git
path: k8s
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: trueRelated terms: CI/CD, Infrastructure as Code, Immutable Infrastructure, Containerization, Orchestration
Related tutorial: ArgoCD GitOps Tutorial
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro