// the find
timebertt/kubernetes-controller-sharding
Horizontally Scalable Kubernetes Controllers: distribute reconciliation of Kubernetes objects across multiple controller instances
A generic sharding layer for Kubernetes controllers that breaks the single-leader constraint and enables active-active horizontal scaling. It works via a `ControllerRing` CRD and a `sharder` component that assigns objects to instances via labels — controllers then filter watches by those labels. This came out of a CS master's thesis but has continued to evolve post-graduation.
The label-selector approach is elegant: each shard watches only its slice of objects, so memory and network costs scale down as you add instances rather than multiplying. The consistent-hash ring implementation is well-tested with benchmarks, and the object drain/rebalance protocol (drain label → acknowledge → stop reconciling) handles the hard case of live migrations without double-reconciliation. The sharder is controller-framework-agnostic — three small behavioral changes and any controller in any language can participate. Solid monitoring story with Prometheus metrics, Grafana dashboards, and pprof integration baked in from the start.
Still v0.x with no stated stability guarantees, and the master's thesis note that docs may lag the code is a real warning — you may hit gaps when the implementation diverges. The sharder is an additional single point of coordination: if it goes down during a rebalance, objects can be in limbo (drain label set, not yet acknowledged). No admission webhook to prevent misconfigured ControllerRings from silently doing nothing. Low adoption (340 stars, 10 forks, one maintainer) means production war stories are nearly nonexistent — you'd be the case study.