Writing a Custom Controller: Extending the Functionality of Your Cluster [I]
summary
Shows how to build a working node reboot operator composed of a DaemonSet agent (watches its node) and a single-instance Deployment controller (replicas=1) that coordinates rolling reboots with a configurable max-unavailable (example uses 1). Uses client-go v2, informers with field selectors and a local cache, and annotations like reboot-needed and reboot-now to communicate desired and actual state. Covers safe patterns: copy cache objects before mutating, wait for cache sync, and links to a functional GitHub demo.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:23What is a controller?
- 1:45How can we use controllers?
- 2:40Building an example We will build a Node Reboot Operator
- 5:07Writing a custom controller
- 6:48Reboot Agent - Determining "self" Downward API
- 8:07Kubernetes client
- 9:56Using the client Re-listing from API can become expensive
- 10:44Creating an Informer
- 13:53Pseudo Reboot Agent
- 15:03Pseudo Reboot Controller
- 18:57Copy cache object before modifying
- 19:13Wait for cache to sync
- 21:48Third Party Resources • Needs a presentation unto itself
- 24:28Helpful Resources
related talks
36mBuilding a Fault-Tolerant Resources Controller on Kubernetes
55mIntroduction to Kubernetes Operators
26mWriting Kubernetes Controllers for CRDs: Challenges, Approaches and Solutions
35mDynamic Multi-Cluster Controllers With Controller-runtime
40mExtending K8s- Introducing Custom Resources, Controllers, Operators & Schedulers
24mKubernetes Operators with Go
43mDeep Dive: Apps SIG
40mDevOps in the Cluster: A deep dive into operators
