Level-Triggered Reconciliation
In plain English
Plain definition
Level-triggered reconciliation evaluates the complete current state rather than depending on every event being delivered. A controller repeatedly compares observed state with desired state and applies an idempotent correction until they converge.
Related reading
Level-triggered reconciliation is the operating model underlying Kubernetes controllers, most operators, and many autoscalers. A controller runs a loop: observe(actualState) -> diff(desiredState, actualState) -> act(). The loop does not depend on remembering what triggered it. Whether invoked because of a watch event, a periodic resync, or a manual requeue, the controller re-derives the full diff from the current state snapshot every time. This is the opposite of an edge-triggered model, where a handler fires once per discrete transition (such as ‘pod created’ or ‘pod deleted’) and must track transition history to remain correct.
What the design buys is idempotency under message loss. In an edge-triggered system, a missed ‘delete’ event leaves a stale resource forever; a duplicate ‘create’ event can double-provision. In a level-triggered system, the next reconciliation pass recomputes the diff and corrects itself, because the loop treats the desired-state object as the single source of truth and the cluster state as ephemeral, disposable evidence. That is why Kubernetes controllers pair watch-based triggers (for low latency) with a periodic resync as a safety net: the resync replays every cached object through the reconciler without re-reading the API server, guarding against requeue bugs; controller-runtime recommends RequeueAfter for catching missed external changes.
- On transient errors, controllers requeue with exponential backoff rather than crashing, because level-triggering tolerates delayed convergence but not divergence that goes unnoticed.
- Reading your own writes is a hazard: if the controller reads from a stale informer cache immediately after writing, it may recompute a diff against outdated state and issue a redundant or conflicting action; optimistic concurrency (resourceVersion checks) mitigates this.
- A resync across thousands of objects can become a thundering herd. It queues them all for reconciliation at once, and the API calls those reconciles make can spike API server load; controller-runtime jitters its resync period by 10 percent to spread this.
- Side effects need the same care. External API calls inside a reconcile function (cloud LB provisioning, for example) must themselves be idempotent, or repeated reconciliation passes will duplicate side effects even though the control loop itself is correct.
The mistake engineers most often make is smuggling edge-triggered logic into a level-triggered controller, for example by storing ‘has this been processed’ flags in memory instead of in the object’s status subresource. This breaks correctness on controller restart, because in-memory state is lost while the reconciler is re-invoked against a resource that now appears ‘new’ but was actually already handled, or vice versa. Status must be persisted as observable state, not inferred from event history.
Legacy Reference
https://kubernetes.io/docs/concepts/architecture/controller/About this page
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Recommended reading
More from KBY that goes with this term.
