The Problem
"GitOps" is often used as if it meant one thing, but there are two very different ways to connect Git to a running cluster. In the push model, a CI pipeline reaches into the cluster and applies changes. In the pull model, an agent inside the cluster watches Git and reconciles itself. They look similar on a whiteboard, but they differ sharply on where credentials live, how drift is caught, and how well they scale to many clusters.
The one-line summary: push sends credentials out to CI; pull keeps credentials inside the cluster and lets an agent reconcile continuously.
The Push Model in Detail
In push-based delivery, the CI/CD pipeline is the actor. After building an image, a pipeline step authenticates to the cluster and applies manifests:
# .github/workflows/deploy.yml (push model)
- name: Deploy to cluster
run: |
echo "$KUBECONFIG_DATA" > kubeconfig
export KUBECONFIG=kubeconfig
helm upgrade --install billing ./chart \
--namespace billing --set image.tag=${{ github.sha }}
env:
KUBECONFIG_DATA: ${{ secrets.PROD_KUBECONFIG }}
The defining trait: the pipeline holds cluster credentials (PROD_KUBECONFIG). The cluster is passive. Once the job finishes, nothing watches the cluster, so any manual change goes undetected until the next deploy.
The Pull Model in Detail
In pull-based delivery, an agent such as ArgoCD or Flux runs in the cluster. It watches a Git repo and applies whatever it finds there. CI's job ends at pushing a new manifest (or image tag) to Git:
# ArgoCD Application (pull model)
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: billing
namespace: argocd
spec:
source:
repoURL: https://github.com/devopskit/deploy.git
targetRevision: main
path: billing
destination:
server: https://kubernetes.default.svc
namespace: billing
syncPolicy:
automated:
selfHeal: true # revert manual drift
prune: true # delete what Git no longer declares
Here CI never touches the cluster. The agent pulls, compares, and reconciles on a loop — so manual kubectl edit changes are reverted automatically.
Side-by-Side Comparison
| Dimension | Push | Pull |
|---|---|---|
| <strong>Who applies changes</strong> | External CI pipeline | In-cluster agent |
| <strong>Cluster credentials</strong> | Stored in CI secrets (higher exposure) | Never leave the cluster |
| <strong>Drift detection</strong> | None by default | Continuous, with self-heal |
| <strong>Firewall direction</strong> | CI must reach the cluster inbound | Cluster reaches out; no inbound port |
| <strong>Scales to many clusters</strong> | Harder — CI needs creds for each | Easier — each cluster pulls itself |
| <strong>Rollback</strong> | Re-run pipeline | Revert the Git commit |
| <strong>Best for</strong> | Simple setups, non-K8s targets | Multi-cluster Kubernetes fleets |
Why Security Favors Pull
In the push model, a leaked CI token can mean a leaked path to production. The pull model removes that attack surface entirely: the cluster initiates an outbound connection to Git, so there is no inbound admin port to expose and no long-lived kubeconfig sitting in a CI secret store. For regulated environments, this difference alone often decides the architecture.
When Push Still Makes Sense
Pull is not universally better. Push is the pragmatic choice when:
- You are deploying to targets that are not Kubernetes (VMs, serverless, a managed PaaS).
- You have a single small cluster and the operational cost of running an agent is not worth it.
- You need imperative, one-off actions (a database migration job) that do not fit a reconcile loop.
- Your team already has mature pipeline tooling and no appetite for a new controller.
Common Mistakes to Avoid
- Calling any Git-triggered deploy "GitOps." A pipeline running
kubectl applyis push automation, not a reconciling GitOps system. Know which one you have. - Leaving
selfHealoff in pull mode. Without it you keep the manual-apply path and lose drift correction — the main reason to use pull. - Storing kubeconfigs for many clusters in one CI system. That central secret store becomes a single, high-value breach target.
- Mixing both models on the same workload. CI pushing while an agent also reconciles leads to a fight where each reverts the other.
- Assuming pull removes CI. You still need CI to build, test, and publish images — it just stops touching the cluster.
FAQ
Is pull always more secure than push?
For Kubernetes, generally yes, because the cluster credentials never leave the cluster and no inbound admin port is exposed. The pull agent only needs outbound read access to Git and the image registry, which is a much smaller attack surface than a stored kubeconfig in CI.
Can I use push and pull together?
You can, but not on the same resource. A common hybrid is pull (ArgoCD/Flux) for application manifests plus push for one-off imperative tasks like migrations. Letting both manage the same object causes reconciliation fights.
Which tools implement the pull model?
ArgoCD and Flux are the two dominant pull-based GitOps controllers for Kubernetes. Both run inside the cluster, watch Git, and reconcile continuously, differing mainly in UI, multi-tenancy, and configuration style.
Does the pull model make rollbacks easier?
Yes. Because Git is the single source of truth, a rollback is just reverting a commit; the in-cluster agent then reconciles the cluster back to the previous state. There is no separate pipeline run or manual kubectl step to coordinate.