Skip to main content

Pull/Push in DevOps

· 2 min read
Loc Nguyen (Luke)
Software Engineer

header-img

Work as DevOps, at least one time you heard "Push-based and Pull-based". So what is it?

Push-based or Pull-based are synchronize code/config between dev, server and repository - but mechanism of synchronization is different.

Push-based

push-based img

In push-based, we'll have an CI/CD flow which active "push" the changes to server. This model usually use in traditional deployment, apply the changes after pipeline run directly.

  • Pros:
    • Easy to deployment
    • Re-use existing pipeline
    • Immediate execution
  • Cons:
    • Hard to track drift
    • Pipeline dependence
    • Rollback missing
    • Security risk
    • Audit challenges

Pull-based

pull-based img

In pull-based, the server actively pulls changes from the project’s repository. This approach is called GitOps, where Git acts as the Single Source of Truth. The workflow is similar to push-based, but with some key differences - The pipeline won't deploy to server directly - We add an agent (ArgoCD / Flux) to the server side, which continuously observes the project’s repository and pulls the changes to apply them to the server whenever updates occur.

  • Pros:
    • Automation
    • Easy rollback
    • Multi-cluster support
  • Cons:
    • Agent installation
    • Complex configuration
    • Polling latency

Comparison

CriteriaPull-BasedPush-Based
Status SynchronizationAutomationManual (triggered by pipeline run)
InstallationInstall agent in server sideNo need agent
Suitable ForKubernetes, multi-cluster, complex projectMedium-sized project, simple pipeline
SecurityMore secure (server only pulls from Git)High risk (pipeline needs direct access to server)