2026-08-23
A pull deployment agent doesn't just fetch desired state once and apply it — it runs a reconciliation loop that continuously compares desired state against actual state and corrects drift. This is the mechanism behind Kubernetes controllers, Flux, and Argo CD. Understand this loop and you understand why cloud-native systems are self-healing.
The loop has three phases, repeated forever:
The critical property is idempotence. Each iteration must be safe to run whether the previous one succeeded, failed halfway, or never ran. The controller doesn't remember "I already created that pod" — it looks, sees the pod exists, and does nothing. This is why crashed controllers can restart without breaking anything.
Real-world example: Kubernetes' Deployment controller. You declare "3 replicas of nginx:1.25." The controller loops every few seconds: it lists pods, counts running instances, and if it sees 2 instead of 3, it creates one. If someone manually kills a pod, the loop notices within a reconcile interval and spawns a replacement. If someone edits a pod's image out-of-band, the loop reverts it. The operator never types "kubectl create" — they change the declared spec, and the loop closes the gap.
Rule of thumb for reconcile intervals: Fast enough to recover before users notice, slow enough not to hammer your API. Argo CD defaults to 3 minutes for Git polling but reacts to webhooks instantly. For in-cluster controllers, 30 seconds is common. If your reconcile takes 5 seconds and runs every 30, you're burning 17% CPU on the loop alone — budget accordingly.
Common failure modes:
The mental shift: stop thinking of deployments as events ("I ran a deploy") and start thinking of them as continuous assertions ("the system should always look like this"). The loop is what turns your Git repo into production.
