Pull-Based vs Push-Based GitOps
What you'll learn: You'll understand the fundamental architectural difference between agents that pull changes from Git versus CI/CD pipelines that push changes to your infrastructure.
The Two GitOps Deployment Philosophies
In GitOps, there are two primary ways to get your desired state from Git into your live environment:
Push-Based Model
In a push-based approach, your CI/CD pipeline (like CodePipeline, Jenkins, or GitHub Actions) actively pushes changes to your infrastructure after detecting a Git commit. The pipeline runs commands that apply changes directly to the target environment.
Think of it like: A delivery service that brings packages to your door the moment they're ready.
Characteristics:
- CI/CD system has credentials to modify infrastructure
- Pipeline executes
kubectl apply,terraform apply, etc. - Changes happen when pipeline runs
- Your cluster is "dumb" — it waits to be told what to do
Pull-Based Model
In a pull-based approach, an agent runs inside your cluster (like ArgoCD or Flux). This agent continuously watches Git and pulls changes, comparing them to the actual cluster state and reconciling differences.
Think of it like: A vigilant assistant who constantly checks the bulletin board and makes sure everything matches what's posted there.
Characteristics:
- Agent has internal cluster access (no external credentials needed)
- Continuous reconciliation loop (every few minutes)
- Self-healing — drift is automatically corrected
- Better security — cluster isn't exposed to external systems
Which Approach Fits GitOps Better?
The pull-based model is considered more aligned with GitOps principles because it implements continuous reconciliation (principle #4 we learned earlier). The cluster actively maintains its desired state rather than passively receiving commands.
Key Takeaway: Pull-based GitOps uses in-cluster agents that continuously reconcile state from Git, while push-based relies on external CI/CD pipelines to apply changes — pull-based offers better security, self-healing, and true continuous reconciliation.