Use this when an in-cluster agent pulls changes.
Pull-based Deployment
Pull-based deployment has an agent inside the target environment, such as Argo CD or Flux, pull changes from Git and apply them, so CI never needs credentials to the cluster.
1. Pull-based deployment: agents pull from git; CI doesn't need cluster credentials.
2. Smaller attack surface.
3. Agent needs read access to repos.
4. Notifications on sync.
5. Works behind firewalls.
git ← agent (pull) → apply in cluster
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
git rev-parse HEADPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Command read-back and what it shows Verify boundary
Verification for GitOps → Pull-based Deployment must distinguish state, not merely report that a command ran. With git rev-parse HEAD, known-good means the approved source ref resolves to the expected commit, the controller reports that commit as observed/applied, and the original service/resource readiness test succeeds without pending reconciliation; known-broken/suspicious means the source ref points elsewhere, the controller remains on an older commit, reconciliation loops/errors persist, or the correct revision is observed while the workload remains degraded. git rev-parse HEAD shows the commit checked out in that local repository only, but it does not show the remote ref, controller-observed revision or target deployment state.
Step 2 Observation-driven branch and next-check logic Narrow the fault
When GitOps → Pull-based Deployment fails, reproduce the smallest original case and capture git rev-parse HEAD before mutation. Use the observation to choose the next check: if repository HEAD is not the intended release, correct promotion/ref first; if repository is correct but controller revision is stale, inspect fetch/authentication/refresh; if controller revision matches but deployment is degraded, inspect render/apply/resource conditions instead of forcing another pull.
Step 3 Common mistakes Narrow the fault
- Agents without RBAC limits.
- An agent inside the cluster pulls changes from Git.
- CI never needs cluster credentials.
- It works behind firewalls.
- Agent runs inside target (Argo CD/Flux in cluster) — pull model
- No CI credentials to cluster — security
argocd repo list / flux get sources git— repo access
ReferenceHow it works1 section · depth on demand
How it works
GitOps → Pull-based Deployment should be reasoned about as a state pipeline, not as one command outcome. The responsible state is the source revision selected by the pull controller, polling/webhook refresh state, reconciliation generation and the target-side objects produced from that revision. A pull-based controller periodically or eventfully fetches a repository ref, records the resolved commit and reconciles desired objects until observed state matches that revision; source fetch and target apply are distinct phases; meanwhile DNS/TLS to the repository, deploy keys/tokens, branch/tag mutability, renderer dependencies and target API permissions are separate things to check. This distinction is especially important because knowing the repository HEAD does not show the controller has fetched it, and a controller at the right commit does not show all resources from that commit are ready.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Pull-based deployment means an agent running inside the target environment fetches desired state from Git and applies it, instead of an external CI system pushing changes in. It is the standard GitOps model.
| Aspect | Pull-based | Push-based |
|---|---|---|
| Who has cluster credentials | Agent inside cluster | CI system |
| Inbound access needed | No | Yes, from CI |
| Drift correction | Continuous | Only at deploy time |
| Examples | Argo CD, Flux | CI job running kubectl apply |
CI still builds and tests images; it only updates Git (for example an image tag), and the agent does the deployment.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in GitOps > Pull-based Deployment. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://opengitops.dev/ · confidence 94%