Writing a Kubernetes Operator: the Hard Parts
Talkat KubeCon + CloudNativeCon North America 2019 · on Wednesday, 2019-11-20· at 15:20· Ballroom Sec 20CD - San Diego Convention Center, Upper Level·
summary
Built an Elastic operator (ECK) using Kubebuilder and controller-runtime and describes concrete problems and fixes: caches are eventually consistent so reconcilers run "behind" leading to duplicate creates unless reconcilers are idempotent and use deterministic naming or an expectations mechanism. Uses a content hash stored in an annotation to decide updates (hash-in-annotation). Shows workarounds for immutable StatefulSet volumeTemplates (create new StatefulSet and migrate data), recommends storageClass waitForFirstConsumer, and explains StatefulSet update strategies and when to manage pods yourself.
AI-written summary · about
chapters (23)
- 0:00Intro
- 1:00What is an operator
- 1:46The reconciliation loop
- 3:41Crew Builder
- 4:40The Hard Parts
- 6:49Problems with Cache
- 7:54Optimistic Concurrency
- 9:45Deleting
- 10:52Consistency
- 11:28Expectations
- 13:23Best Practices
- 15:14Stateful Sets
- 16:15Reverse Order
- 16:38Decouple
- 18:05Comparing
- 18:46Metadata
- 19:36Comparison Functions
- 20:11Stateful Revision
- 24:40Resize Volumes
- 25:20Migration
- 26:10Volume Binding Mode
- 30:06Update Strategy
- 32:28StatefulSets
related talks
21mStory of a Kubernetes Go Operator
46mOperators Live in the Past: Designing Reliable Kubernetes Controllers
24mKubernetes Operators with Go
36mLessons learned writing 10+ Kubernetes Operators - Lars Francke and Jannik Heyl
55mIntroduction to Kubernetes Operators
14mDemystifying k8s operators
43mLessons learned writing 10+ Kubernetes Operators
32mMinimalist Best Practices in Kubernetes Operators
