How Kubernetes Controllers Actually Work: Reconcile, Resyncs, and Predicates Tested

A developer built a minimal Kubernetes operator called Echo — managing a Deployment, Service, and ConfigMap — and deliberately broke it ten times per failure mode to measure four widely misunderstood controller mechanics. The reconcile function receives only a namespace and name, not a diff, meaning it always re-reads desired state from scratch rather than acting on what changed — a deliberate level-triggered design choice. Testing on a local kind cluster showed reconcile ran with a mean latency of 2.71ms, with all 77 measured runs completing under 25ms. A short resync period added zero extra API server requests because controllers cache state locally rather than polling the API directly. Using GenerationChangedPredicate reduced steady-state reconcile calls by 48.5% without affecting live fault repair, making it a meaningful optimisation at scale.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in