Skip to main content
CI/CD·6 min read

GitOps Push vs Pull — Two Deployment Architectures Compared

A clear comparison of push-based and pull-based GitOps: how each delivers changes to a cluster, their security and drift-detection trade-offs, and when to pick one over the other.

DT

DevOps Engineer & Technical Writer

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.

PUSH vs PULL — WHERE DOES THE DEPLOY HAPPEN? PUSH MODEL CI Pipeline kubectl / helm · holds cluster creds push Cluster workloads applied no agent · no drift check PULL MODEL Git Repo desired state (source of truth) pull Cluster in-cluster agent reconcile loop · self-heal ↻ continuous drift correction

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

DimensionPushPull
<strong>Who applies changes</strong>External CI pipelineIn-cluster agent
<strong>Cluster credentials</strong>Stored in CI secrets (higher exposure)Never leave the cluster
<strong>Drift detection</strong>None by defaultContinuous, with self-heal
<strong>Firewall direction</strong>CI must reach the cluster inboundCluster reaches out; no inbound port
<strong>Scales to many clusters</strong>Harder — CI needs creds for eachEasier — each cluster pulls itself
<strong>Rollback</strong>Re-run pipelineRevert the Git commit
<strong>Best for</strong>Simple setups, non-K8s targetsMulti-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 apply is push automation, not a reconciling GitOps system. Know which one you have.
  • Leaving selfHeal off 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.