Writing kube controllers for everyone
summary
Explains how to build a real Kubernetes controller using client-go primitives: workqueue, shared informers with listers, and rate‑limiting queues; shows a CronJob controller (~400 lines) and argues it’s a poor exemplar while Job controller is cleaner. Covers the actual control loop: get key, fetch from cache, deep‑copy before mutation, perform work, requeue on error with backoff, forget on success. Lists 11 rules controllers must follow (one item at a time, no ordering assumptions, use owner references, wait for caches, etc.).
AI-written summary · about
chapters (10)
- 0:00Start
- 3:59Where do I start?
- 17:07Operate on one item at a time
- 17:23Random ordering between resources
- 18:36Level driven, not edge driven
- 19:06Use Shared Informers
- 20:05Never mutate original objects
- 20:54There are other actors in the system
- 22:21Use ObservedGeneration when possible
- 22:46Consider using owner references
related talks
31mIt's all about reconciliation - anatomy of a kubernetes controller
28mThe Kubernetes Control Plane for Busy People Who Like Pictures
27mDemystifying Why the World Is Built on Kubernetes: Learning To Leverage Bespoke CRDs and Controllers
36mUnderstanding Kubernetes Through Real-World Phenomena and Analogies
32mDon't Write Controllers Like Charlie Don't Does: Avoiding Common Kubernetes Controller Mistakes
26mWriting Kubernetes Controllers for CRDs: Challenges, Approaches and Solutions
36mBuilding a Fault-Tolerant Resources Controller on Kubernetes
31mKubernetes is Your Platform: Design Patterns For Extens...
