Push vs Pull Deployment Models: Differences Explained

Push vs pull deployment: how each model works, security, drift, rollback and scale compared, Argo CD and Flux examples, and the hybrid most teams use.

Aug 18, 2025 - 17:13
Nov 6, 2026 - 15:12
 0  237
TOPICDevOps BasicsPractical guide
Push vs Pull Deployment Models: Differences Explained

In a push-based deployment, an external system such as a CI/CD pipeline connects to the target environment and applies changes. In a pull-based deployment, an agent running inside the target watches a source of truth, usually a Git repository or registry, and pulls changes in itself. Push is simpler to start with; pull keeps credentials inside the environment and corrects drift continuously.

This guide compares the two models in depth: how each works, where each fits outside Kubernetes as well as inside it, how they differ on security, drift, rollback, scale and auditing, and how most teams end up combining them. Tool behaviour was checked against the Argo CD, Flux, Kubernetes, Puppet and Ansible documentation in November 2026.

Key takeaways

  • The difference is who initiates the change. In push, the pipeline reaches into the target. In pull, the target reaches out to the source.
  • Push suits non-Kubernetes targets, one-off tasks and teams starting out. Jenkins, GitHub Actions, GitLab CI, Ansible and Terraform usually work this way.
  • Pull is the model behind GitOps. Argo CD and Flux run in the cluster, compare live state with Git and reconcile differences.
  • Pull does not need inbound access to production or cluster-admin credentials stored in CI, which shrinks the attack surface.
  • Pull continuously detects and can revert manual changes (drift). Push only changes state when a pipeline runs.
  • Most real systems are hybrid: CI pushes images and manifest updates to Git or a registry, and an in-cluster agent pulls them.

Push vs pull at a glance

AspectPush-basedPull-based
Who starts the changeCI/CD server or operatorAgent in the target environment
Network directionInbound to the target (API server, SSH, cloud API)Outbound from the target to Git or a registry
Where credentials liveIn the CI systemIn the target environment
Drift handlingNone between runsDetected continuously; can auto-revert
Feedback on deploy resultImmediate, in the pipeline logAsynchronous, in the agent's UI, CLI or notifications
RollbackRerun the pipeline with an older versionRevert the commit; the agent applies it
Scaling to many targetsPipeline must know and reach every targetEach target pulls independently
Typical toolsJenkins, GitHub Actions, GitLab CI, Ansible, Terraform, Helm from CIArgo CD, Flux, Puppet agent, Chef Infra Client, ansible-pull
Best fitVMs, serverless, databases, simple setups, imperative tasksKubernetes, fleets of clusters, edge sites, regulated environments

How push-based deployment works

A push pipeline usually looks like this:

  1. A developer merges a change.
  2. The CI system builds, tests and packages it (container image, JAR, ZIP).
  3. A deploy stage authenticates to the target with stored credentials.
  4. The stage runs commands that change the target: kubectl apply, helm upgrade, aws ecs update-service, terraform apply, an Ansible playbook over SSH.
  5. The pipeline reports success or failure.

Here is a minimal GitHub Actions job that pushes a release to Kubernetes:

name: deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v4
      - name: Configure kubeconfig
        run: |
          mkdir -p ~/.kube
          echo "${{ secrets.KUBECONFIG_PROD }}" > ~/.kube/config
      - name: Deploy with Helm
        run: |
          helm upgrade --install shop ./charts/shop \
            --namespace shop \
            --set image.tag=${{ github.sha }} \
            --wait --timeout 5m

The job holds a kubeconfig for production in a secret. Anyone who can change the workflow file, or compromise the runner, can act with those credentials. Many teams reduce that risk with short-lived credentials from OIDC federation (for example GitHub Actions to AWS IAM, then aws eks update-kubeconfig), protected environments and required reviewers. Our guide to multi-environment deployment with GitHub Actions shows that setup.

Push outside Kubernetes

Push is the default model for most targets that are not Kubernetes:

  • Virtual machines: Ansible connects over SSH (or WinRM) from a control node and applies playbooks.
  • Cloud infrastructure: Terraform or OpenTofu runs plan and apply against cloud APIs from a pipeline or a platform such as HCP Terraform.
  • Serverless and managed services: pipelines call AWS SAM, CloudFormation, the Serverless Framework or cloud CLIs.
  • Database migrations: tools such as Flyway or Liquibase run from a pipeline stage, once, in order.

Strengths of push

  • Easy to understand. The pipeline is the whole story: build, test, deploy, in one log.
  • Immediate feedback. If the deploy fails, the pipeline goes red and the author sees it.
  • Works with anything that has an API. No agent to install.
  • Good for imperative, ordered steps, such as running a migration before switching traffic.
  • Fewer moving parts for a small team with one or two environments.

Weaknesses of push

  • Broad credentials in CI. The CI system becomes a high-value target because it can change production.
  • Inbound access. The target must accept connections from CI runners, which can conflict with private clusters and firewalled sites.
  • No drift correction. A manual kubectl edit stays in place until the next deploy overwrites it, or silently forever if nobody redeploys.
  • Scaling pain. Deploying to 50 clusters means 50 sets of credentials and 50 network paths from the pipeline.
  • State is implied. Git holds the pipeline, not necessarily the full desired state of the environment.

How pull-based deployment works

In a pull model, an agent inside the environment does the deploying:

  1. The desired state lives in a Git repository (or an OCI registry, or a Helm repository).
  2. An agent in the target polls the source, or receives a webhook telling it to check now.
  3. The agent compares desired state with live state.
  4. If they differ, it applies the change from inside the environment.
  5. It keeps checking, so later drift is spotted and, if configured, reverted.

The OpenGitOps project, a CNCF sandbox project, defines GitOps through four principles: desired state is declarative, versioned and immutable, pulled automatically and continuously reconciled. The third principle is the pull model. For background, read what GitOps is.

Argo CD example

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: shop
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/example/shop-config.git
    targetRevision: main
    path: overlays/production
  destination:
    server: https://kubernetes.default.svc
    namespace: shop
  syncPolicy:
    automated:
      prune: true      # delete resources removed from Git
      selfHeal: true   # revert changes made directly in the cluster
    syncOptions:
      - CreateNamespace=true

By default, Argo CD checks Git every 120 seconds plus up to 60 seconds of jitter, controlled by timeout.reconciliation in the argocd-cm ConfigMap. A Git webhook makes it react almost immediately. With selfHeal: true, Argo CD re-syncs when live state drifts from Git.

Flux example

apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: shop-config
  namespace: flux-system
spec:
  interval: 1m
  url: https://github.com/example/shop-config
  ref:
    branch: main
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: shop
  namespace: flux-system
spec:
  interval: 10m
  sourceRef:
    kind: GitRepository
    name: shop-config
  path: ./overlays/production
  prune: true
  wait: true

Flux splits the job into controllers. The source controller fetches the repository on its interval, and the kustomize controller applies the manifests and re-applies them on its own interval, which corrects drift. Our post on how Argo CD and Flux enable declarative deployments compares the two tools.

Pull before Kubernetes

Pull is older than GitOps. Configuration management tools have used it for years:

  • Puppet: the agent on each node requests a catalog from the Puppet server on a schedule (every 30 minutes by default, set by runinterval) and enforces it.
  • Chef Infra: Chef Infra Client runs on each node, fetches its run-list and cookbooks from Chef Infra Server and converges the node.
  • ansible-pull: inverts Ansible's usual push model. Each node clones a repository and runs a playbook against itself, typically from a cron job or systemd timer.

Strengths of pull

  • Smaller attack surface. CI never needs cluster credentials. The agent needs only read access to Git and permission inside its own cluster.
  • Outbound-only networking. Private clusters and edge sites behind NAT can still deploy, because they connect out.
  • Drift detection and repair. The agent shows when live state differs from Git and can fix it.
  • Git as the audit log. Every change is a commit with an author, a review and a timestamp.
  • Fleet scale. Adding a cluster means installing the agent and pointing it at the right path; the pipeline does not change.
  • Simple rollback. git revert returns the environment to a known state.

Weaknesses of pull

  • Another system to run. The agent needs upgrades, monitoring, RBAC and high availability.
  • Delayed, indirect feedback. The pipeline that merged the change does not see the deploy result unless you wire up notifications or status checks.
  • Secrets need a pattern. Plain secrets cannot go in Git. You need Sealed Secrets, SOPS, External Secrets Operator or a similar tool.
  • Imperative steps are awkward. Ordered tasks such as database migrations need hooks or sync waves (Argo CD) or dependencies (Flux).
  • Mostly Kubernetes-centric today. Argo CD and Flux target Kubernetes. For VMs you are back to configuration management agents.

Comparing the models on what matters in production

Security and credentials

This is the most cited reason teams move to pull. In push, the CI system stores credentials that can change production, and the target must accept connections from CI. Supply-chain attacks against CI systems and their plugins or actions make that a real concern. In pull, the cluster holds its own credentials and reaches out only to read. The CI system can still be compromised, but the attacker would have to get a malicious change merged into the config repository, where branch protection and review apply.

Pull does not remove the need for least privilege. An Argo CD instance with cluster-admin across many clusters is also a high-value target, so restrict its projects, destinations and allowed resource kinds. For secret handling in Git-driven setups, see secret management in GitOps workflows.

Drift detection

Drift happens when someone changes the environment outside the normal process: a hotfix with kubectl scale, an edited ConfigMap, a resource deleted by mistake. Push pipelines do not notice until the next run. Pull agents compare continuously. Argo CD marks the application OutOfSync; with self-heal enabled it reapplies Git state. For Terraform-managed cloud resources, which are usually pushed, teams run scheduled terraform plan jobs to spot drift instead.

Deployment feedback and observability

Push wins on immediacy: the deploy step fails and the pipeline shows why. With pull, the merge succeeds and the deploy happens later. Close that gap with Argo CD Notifications or the Flux notification controller (posting to Slack, Teams or commit statuses), and with health checks so that "synced" also means "healthy".

Rollback

In push, rollback usually means rerunning an older pipeline or running helm rollback. In pull, you revert the commit and the agent applies the previous state. Both approaches work. Pull keeps the rollback in Git history, which is clearer for auditors. Note that if you roll back by hand in the cluster while self-heal is on, the agent will undo your rollback; revert in Git instead, or pause automated sync first.

Scale and multi-cluster

One push pipeline deploying to many clusters must hold credentials for each and handle partial failures. With pull, each cluster runs an agent, or a central Argo CD manages several clusters through registered credentials. Argo CD ApplicationSets and Flux's per-cluster paths make fleet rollouts manageable. See GitOps in multi-cluster Kubernetes setups.

Compliance and audit

Regulators and auditors ask who changed what, when, and who approved it. In pull, the config repository answers that directly: pull requests, reviews and signed commits. Push can provide the same through pipeline logs and approvals, but the record is split across CI history and whatever changed in the environment outside CI.

Speed of delivery

Neither model is inherently faster. Push applies immediately at the end of a pipeline. Pull adds a short delay (seconds with webhooks, minutes with polling). Progressive delivery, such as canaries, adds more time in either model, and that time is deliberate.

Detailed comparison table

ConcernPushPullPractical note
Setup effortLowMediumPull needs an agent install, RBAC and repo structure.
Credential exposureHigh (CI holds prod access)Lower (agent holds in-cluster access)Use OIDC and short-lived tokens if you stay with push.
Firewall friendlinessNeeds inbound pathOutbound onlyImportant for private clusters and edge.
DriftNot detectedDetected, optionally revertedDecide per app whether self-heal is safe.
Ordered imperative stepsNaturalVia hooks, sync waves, dependenciesKeep migrations idempotent either way.
Non-Kubernetes targetsNaturalNeeds a CM agent or none availableMost VM and serverless deploys stay push.
Multi-clusterGrows complexScales wellApplicationSets or per-cluster Flux paths.
Audit trailCI logsGit historyProtect the config repo like production.

Push and pull for cloud infrastructure

The comparison so far has centred on applications in Kubernetes. Cloud infrastructure follows the same split, with different tools.

Push: Terraform and CloudFormation from a pipeline

Most teams manage VPCs, databases and IAM with Terraform, OpenTofu or CloudFormation run from CI. A typical flow runs terraform plan on a pull request, posts the plan for review, and runs terraform apply after merge. This is push: the pipeline holds cloud credentials and calls cloud APIs. The same advice applies as for Kubernetes push pipelines: use OIDC federation and short-lived roles, separate plan and apply permissions, and require approval for production.

# GitHub Actions: plan on PR, apply on main, with short-lived AWS credentials
permissions:
  id-token: write
  contents: read

jobs:
  terraform:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::123456789012:role/terraform-ci
          aws-region: ap-south-1
      - uses: hashicorp/setup-terraform@v3
      - run: terraform init -input=false
      - run: terraform plan -input=false -out=tfplan
      - if: github.ref == 'refs/heads/main'
        run: terraform apply -input=false tfplan

Pull: controllers that reconcile cloud resources

Kubernetes-native controllers can manage cloud resources in a pull model. Crossplane lets you declare cloud resources as Kubernetes objects and reconciles them continuously. Cloud-specific controllers such as AWS Controllers for Kubernetes (ACK) and Google Config Connector do the same for their providers. Combined with Argo CD or Flux, infrastructure changes follow the same Git-to-cluster path as applications, and drift in cloud resources is corrected automatically.

The trade-off is more moving parts: the management cluster becomes critical infrastructure, and debugging a reconciliation loop is different from reading a Terraform plan. Many organisations keep Terraform for foundations (accounts, networks) and use controllers for per-application resources such as queues, buckets and databases.

A reference architecture, step by step

Here is how a mid-sized team might lay out a hybrid setup for three environments.

ComponentModelWhat it does
Application repositorySourceCode, Dockerfile, unit tests
CI pipelinePush to registryBuild, test, scan and sign the image; push to the registry
Config repositorySource of truthKustomize base and overlays for dev, staging and prod
Image automation or botPush to GitOpens a PR updating the image tag for dev; promotion PRs for staging and prod
Argo CD or Flux per clusterPullReconciles its environment's overlay
Argo Rollouts or FlaggerIn-clusterCanary analysis and automatic abort in prod
Terraform pipelinePushClusters, networks, IAM and shared services

Promotion between environments becomes a pull request that changes one tag in one overlay. Reviewers see exactly what will change, and the merge is the approval record. If production misbehaves, reverting that pull request restores the previous version.

shop-config/
  base/
    deployment.yaml
    service.yaml
    kustomization.yaml
  overlays/
    dev/kustomization.yaml        # newTag updated automatically
    staging/kustomization.yaml    # promoted by PR
    production/kustomization.yaml # promoted by PR with required review

Security checklist for each model

If you push

  • Use OIDC federation and short-lived credentials instead of stored keys or long-lived kubeconfigs.
  • Scope deploy credentials to the namespaces and actions the pipeline needs.
  • Protect production environments with required reviewers and branch rules.
  • Pin third-party CI actions and plugins to specific versions or commit SHAs.
  • Use private runners inside the network for private clusters rather than opening the API server to the internet.

If you pull

  • Protect the config repository like production: branch protection, required reviews, signed commits where possible.
  • Give the agent read-only Git credentials, such as a deploy key.
  • Restrict Argo CD projects to allowed source repositories, destination namespaces and resource kinds.
  • Keep secrets out of Git with Sealed Secrets, SOPS or External Secrets Operator.
  • Monitor the agent itself and alert on sync failures and degraded applications.

The hybrid model most teams use

In practice, CI and GitOps work together. CI still pushes, but only to Git or a registry, never to the cluster:

  1. CI builds and tests the application, then pushes a signed image to the registry.
  2. CI (or an automation bot) opens a pull request that updates the image tag in the config repository, or an image automation tool commits it.
  3. The pull request is reviewed and merged.
  4. Argo CD or Flux in the cluster detects the commit and pulls the change.
  5. A progressive delivery controller such as Argo Rollouts or Flagger shifts traffic gradually and aborts on bad metrics.

Flux's image reflector and image automation controllers, and Argo CD Image Updater, can automate step 2 by watching the registry for new tags that match a policy. Keeping application code and environment config in separate repositories avoids loops where a config commit triggers a new application build.

# CI job: update the config repo instead of touching the cluster
update-config:
  stage: release
  image: alpine/git:latest
  script:
    - git clone https://oauth2:${CONFIG_REPO_TOKEN}@gitlab.example.com/platform/shop-config.git
    - cd shop-config/overlays/production
    - sed -i "s|newTag: .*|newTag: ${CI_COMMIT_SHORT_SHA}|" kustomization.yaml
    - git commit -am "shop: deploy ${CI_COMMIT_SHORT_SHA}"
    - git push origin main
  rules:
    - if: $CI_COMMIT_BRANCH == "main"

This GitLab CI job writes directly to main for brevity. In a regulated setup it would open a merge request instead. The rollout strategies that sit on top of either model are described in 12 CI/CD deployment rollout types.

How to choose

Choose push when

  • Your targets are VMs, serverless functions, managed databases or SaaS APIs.
  • You have one or two environments and a small team.
  • You need ordered, imperative steps that are hard to express declaratively.
  • You are starting out and want the simplest working pipeline.

Choose pull when

  • You run Kubernetes, especially several clusters.
  • Clusters are private, behind NAT or at edge locations.
  • Security policy forbids CI from holding production credentials.
  • Auditors need a clear change history and approval trail.
  • Manual changes in production keep causing incidents.

Migrating from push to pull

  1. Move every manifest the pipeline applies into a config repository, rendered or as Helm/Kustomize sources.
  2. Install Argo CD or Flux and point it at a non-production environment first, with automated sync but without self-heal.
  3. Remove the deploy step from CI for that environment; replace it with a config repository update.
  4. Add notifications and health checks so the team sees deploy results.
  5. Turn on self-heal and pruning once the team is comfortable, then repeat for production.
  6. Revoke the cluster credentials CI no longer needs.

For a view of why many teams prefer GitOps once they have Kubernetes, read why GitOps is preferred over push-based deployments. To practise interview questions on these patterns, see scenario-based Argo CD interview questions.

Common mistakes

  • Running both models against the same resources. A pipeline applying manifests while Argo CD self-heals the same objects causes a tug of war. Pick one owner per resource.
  • Committing plain secrets to the config repository. Use an encryption or external secrets tool.
  • Using mutable tags such as latest in Git. The agent cannot tell that anything changed, and rollback becomes guesswork. Pin tags or digests.
  • Giving the GitOps agent unlimited permissions across every cluster and namespace.
  • Ignoring feedback. Without notifications, a pull deployment can fail quietly while the merge looks successful.
  • Enabling self-heal before people stop making manual hotfixes, which leads to confusing reverts during incidents.

Glossary

  • Desired state: the configuration you want the environment to have, stored declaratively in Git or another source.
  • Live state: what is actually running in the environment right now.
  • Reconciliation: the loop in which an agent compares desired and live state and acts to remove differences.
  • Drift: any difference between desired and live state that was not made through the normal change process.
  • Sync: in Argo CD, the act of applying desired state to the cluster. An application is Synced when live state matches Git and OutOfSync when it does not.
  • Self-heal: automatic re-sync when live state drifts, without a new commit.
  • Prune: deleting resources from the cluster that were removed from Git.
  • Sync waves and hooks: Argo CD features that order resources and run jobs before or after a sync, used for steps such as database migrations.
  • Progressive delivery: releasing to a small share of users first and widening the rollout based on metrics, as in canary and blue-green releases.
  • Config repository: a Git repository that holds environment configuration, separate from application source code.

Learn both models hands-on

Push pipelines with Jenkins and GitLab CI, and GitOps with Argo CD on Kubernetes, are both part of our DevOps training, taught in Kharadi, Pune and live online. If Kubernetes administration is your focus, the CKA training covers the cluster side that GitOps agents work against.

FAQ

What is the main difference between push and pull deployment?

Who starts the change. In push, a CI/CD system connects to the environment and applies the deployment. In pull, an agent inside the environment watches Git or a registry and applies changes itself.

Is GitOps always pull-based?

The OpenGitOps principles say desired state is pulled automatically and continuously reconciled, so pull is the standard GitOps model. Some teams call a push pipeline that applies manifests from Git "GitOps", but it lacks continuous reconciliation.

Is pull-based deployment more secure?

Usually, because CI no longer needs production credentials and the cluster needs no inbound access. The agent and the config repository then become the assets to protect with least privilege, branch protection and review.

Can Jenkins do pull-based deployment?

Jenkins itself is a push tool: its jobs connect out to targets. It fits a pull model by building images and updating the config repository, while Argo CD or Flux performs the actual deployment.

How does Argo CD know when Git changes?

It polls repositories every 120 seconds plus up to 60 seconds of jitter by default, and it can receive Git webhooks to refresh immediately.

What is drift in deployments?

Drift is any difference between the desired state in Git and the live state of the environment, usually caused by manual changes. Pull agents detect it continuously; push pipelines only overwrite it on the next run.

Is Ansible push or pull?

Ansible is push by default: a control node connects to hosts over SSH. The ansible-pull command reverses this so each host fetches a repository and runs the playbook locally.

Should I use push or pull for serverless and VMs?

Push is usually simpler there, through Terraform, CloudFormation, SAM or Ansible. Pull with configuration management agents such as Puppet or Chef also works for large VM fleets.

References

Interested in learning more?Get a callback from our training advisors.

What's Your Reaction?

Like Like 0
Dislike Dislike 1
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.