Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Level Triggered and Reconciled: How Kubernetes Manages its State
Search
James Bowes
May 16, 2018
Technology
0
89
Level Triggered and Reconciled: How Kubernetes Manages its State
James Bowes
May 16, 2018
Tweet
Share
More Decks by James Bowes
See All by James Bowes
Write Once, Compile Lots, Run Anywhere
jbowes
0
130
A Token Of Respect: Implementing Microservice Identity And Access Management In Go
jbowes
0
160
Shattered Mirror: An Introduction to Reflect and Unsafe
jbowes
0
34
Shattered Mirror: An Introduction to Reflect and Unsafe
jbowes
0
1.3k
Cloud Jumping With Kubernetes
jbowes
0
72
Building APIs for an unreliable world
jbowes
0
52
API Design Lessons From Kubernetes
jbowes
0
81
CL_Eye-Catching_User_Interfaces.pdf
jbowes
0
41
Higher-Order Deployments: Reducing Boilerplate With Kubernetes Custom Resource Definitions
jbowes
0
42
Other Decks in Technology
See All in Technology
GrafanaMeetup_AmazonManagedGrafanaのアクセス制御機能とマルチテナント環境下でのアクセス制御について
daitak
0
250
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.7k
生産性向上チームの紹介
cybozuinsideout
PRO
1
870
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
200
生成AIの変革の時代に、直近1年で直面した課題とその解決策
ktc_wada
0
340
On Your Data を超えていく!
hirotomotaguchi
2
690
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
300
web-application-security
matsuihidetoshi
0
170
20分で完全に理解するGrafanaダッシュボード
hamadakoji
3
690
Building Dashboards as a Hobby
egmc
0
240
チームでロジカルシンキングに改めて向き合っている話 〜学習環境と実践⽅法〜
sansantech
PRO
3
2.7k
開発パフォーマンスを最大化するための開発体制
ham0215
2
450
Featured
See All Featured
Docker and Python
trallard
34
2.7k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Why Our Code Smells
bkeepers
PRO
331
56k
In The Pink: A Labor of Love
frogandcode
138
21k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
Become a Pro
speakerdeck
PRO
11
4.5k
Designing for humans not robots
tammielis
248
25k
Clear Off the Table
cherdarchuk
84
310k
Web development in the modern age
philhawksworth
202
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Transcript
@jrbowes Level-Triggered and Reconciled How Kubernetes Manages its State
@jrbowes @jrbowes Photo by Stefan Steinbauer on Unsplash STUDY TIME
@jrbowes https://www.manifold.co Say hi at our booth! James Bowes Technical
Lead
@jrbowes @jrbowes Photo by Maximilian Weisbecker on Unsplash KUBERNETES?
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes Photo by Gamze Bozkaya on Unsplash THE CLIENT
API
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes Photo by Jakob Owens on Unsplash PATCHING
@jrbowes JSON Merge Patch • Plain JSON document only containing
changes • Declarative and simple • RFC 7386
@jrbowes JSON Merge Patch ... metadata: labels: service: worker app:
marketplace spec: containers: - image: manifold/worker:1.31.18 name: worker
@jrbowes JSON Merge Patch metadata: labels: service: billing-worker spec: containers:
- image: manifold/sidecar:1.0.0 name: metrics
@jrbowes JSON Merge Patch ... metadata: labels: service: billing-worker app:
marketplace spec: containers: - image: manifold/sidecar:1.0.0 name: metrics
@jrbowes JSON Merge Patch ... metadata: labels: service: billing-worker app:
marketplace spec: containers: - image: manifold/sidecar:1.0.0 name: metrics
@jrbowes JSON Merge Patch • Objects are always merged •
Arrays are always replaced • No explicit null See also JSON Patch (RFC 6902) - Verbose and complex
@jrbowes Strategic Merge Patch • Adds replace, merge, delete for
objects and arrays • Merge keys for array elements • Schema defined defaults • Client directive overrides
@jrbowes Strategic Merge Patch ... metadata: labels: service: worker app:
marketplace spec: containers: - image: manifold/worker:1.31.18 name: worker
@jrbowes Strategic Merge Patch spec: containers: - image: manifold/sidecar:1.0.0 name:
metrics
@jrbowes Strategic Merge Patch ... spec: containers: - image: manifold/worker:1.31.18
name: worker - image: manifold/sidecar:1.0.0 name: metrics
@jrbowes Strategic Merge Patch ... spec: containers: - image: manifold/worker:1.31.18
name: worker - image: manifold/sidecar:1.0.0 name: metrics
@jrbowes Strategic Merge Patch spec: containers: - image: manifold/sidecar:1.0.0 name:
metrics - $patch: replace
@jrbowes lastAppliedConfiguration PROVIDES RICH CONTEXT
@jrbowes PRESERVE THE INTENT OF EVERY CLIENT
@jrbowes @jrbowes Photo by Gamze Bozkaya on Unsplash THE INTERNAL
MODEL
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes Photo by David Kovalenko on Unsplash LOST DATA
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes Photo by Fabrizio Verrecchia on Unsplash SLOW REACTIONS
@jrbowes @jrbowes
@jrbowes @jrbowes
@jrbowes @jrbowes Photo by Matt Artz on Unsplash PREVENTION AND
REPAIR
@jrbowes Lost Intermediate Data • Edge triggered ◦ Track last
seen revision number ◦ Perform a resync on missing version • Not an issue for level triggered
@jrbowes Stale Data • Heartbeat • Periodic resync (done in
Kubernetes)
@jrbowes Slow Reactions • Edge triggered ◦ Keep state for
last value ◦ Compute change to apply with real value, last seen, and changed • Not an issue for level triggered
@jrbowes @jrbowes
@jrbowes KEEP THE CONSUMER LOGIC SIMPLE
@jrbowes @jrbowes Photo by Hans-Peter Gauster on Unsplash PIECING IT
TOGETHER
@jrbowes Controllers are Clients, too • resourceVersion is used for
watching • Controllers may implement their own lastAppliedConfiguration • Different annotations allow unique targeting
@jrbowes TCP implementations should follow a general principle of robustness:
be conservative in what you do, be liberal in what you accept from others. - Jon Postel, RFC 761
@jrbowes be exhaustive in what you send, be explicit in
what you receive from others.
@jrbowes @jrbowes Photo by Annie Spratt on Unsplash WRAPPING UP
@jrbowes @jrbowes Photo by Michael Hoyt on Unsplash COLOCATE COMPLEX
LOGIC WITH STATE
@jrbowes @jrbowes Photo by Roman Koester on Unsplash IDENTIFY THE
AUDIENCE AND BUILD FOR THEM
@jrbowes @jrbowes Photo by Andrés Canchón on Unsplash MAKE IT
HARD FOR THE AUDIENCE TO FAIL
@jrbowes Thank you!