Slide 1

Slide 1 text

Understanding Kubernetes Through Real-World Phenomena and Analogies Lucas Käldström - CNCF Ambassador May 19, 2022 – Valencia Image credit: CNCF

Slide 2

Slide 2 text

© 2022 Lucas Käldström 2 $ whoami Lucas Käldström, 3rd-year BSc student at Aalto University, Finland CNCF Ambassador, Certified Kubernetes Administrator and Emeritus Kubernetes WG/SIG Lead KubeCon Speaker in Berlin, Austin, Copenhagen, Shanghai, Seattle, San Diego & Valencia KubeCon Keynote Speaker in Barcelona Former Kubernetes approver and subproject owner, active in the OSS community for 6+ years. Worked on e.g. SIG Cluster Lifecycle => kubeadm to GA. Weaveworks contractor, Weave Ignite & libgitops author Cloud Native Nordics co-founder & meetup organizer Guild of Automation and Systems Technology CFO

Slide 3

Slide 3 text

© 2022 Lucas Käldström 3 Credits to Simon Sinek

Slide 4

Slide 4 text

© 2022 Lucas Käldström 4 What problem are we trying to solve?

Slide 5

Slide 5 text

© 2022 Lucas Käldström 5 Based on decades of experience

Slide 6

Slide 6 text

But is it inherently “too complex” for most?

Slide 7

Slide 7 text

Problems hiding in plain sight It just takes longer for small-scale users to notice problems due to e.g. randomness

Slide 8

Slide 8 text

Kubernetes and the Orchestra

Slide 9

Slide 9 text

So… You wanna play a piece of music

Slide 10

Slide 10 text

But you have no conductor :(

Slide 11

Slide 11 text

Will the orchestra itself be able to play?

Slide 12

Slide 12 text

Maybe, maybe not

Slide 13

Slide 13 text

You need a conductor and good musicians

Slide 14

Slide 14 text

© 2022 Lucas Käldström 14 The 4 Whys: 1. The control plane is for Coordination, yet allows Improv (Joe Beda, 2017)

Slide 15

Slide 15 text

You need one sheet of music per musician

Slide 16

Slide 16 text

© 2022 Lucas Käldström 16

Slide 17

Slide 17 text

© 2022 Lucas Käldström 17 Declarative vs Imperative “declarative” = “making a declaration” “declare” = “to make known as a determination” (Merriam-Webster, 2021) Declarative: “The door is shut” (state) Imperative: “Shut the door!” (action)

Slide 18

Slide 18 text

© 2022 Lucas Käldström 18 The Imperative - Declarative spectrum Importance Declarative Imperative What How

Slide 19

Slide 19 text

© 2022 Lucas Käldström 19 Imperative – Declarative examples C – Imperative Haskell – Declarative PNG – Imperative SVG – Declarative Manually storing data in files – Imperative SQL – Declarative

Slide 20

Slide 20 text

Interfaces / APIs are key

Slide 21

Slide 21 text

© 2022 Lucas Käldström 21 Abstraction Layers: Pluggable interfaces Cloud Native is all about pluggable APIs forming consistent abstractions that projects can implement and/or rely on. These CNCF/LF projects contain only a specification, no implementation:

Slide 22

Slide 22 text

© 2022 Lucas Käldström 22 The 4 Whys: 1. The control plane is for Coordination, yet allows Improv 2. Declarativeness is for Portability and Desired State

Slide 23

Slide 23 text

Chaos is Inevitable

Slide 24

Slide 24 text

© 2022 Lucas Käldström 24 Entropy: Systems become less ordered Time Entropy Order Start Stop Chaos

Slide 25

Slide 25 text

© 2022 Lucas Käldström 25 Entropy: Putting order to chaos Time Entropy Order Start Stop Chaos Reversing, ordering process

Slide 26

Slide 26 text

© 2022 Lucas Käldström 26 Kubernetes: The dishwasher of servers Time Entropy Order Start Stop Chaos Reversing, ordering process

Slide 27

Slide 27 text

© 2022 Lucas Käldström 27 Kubernetes: The dishwasher of servers

Slide 28

Slide 28 text

© 2022 Lucas Käldström 28 Kubernetes: The dishwasher of servers

Slide 29

Slide 29 text

© 2022 Lucas Käldström 29

Slide 30

Slide 30 text

© 2022 Lucas Käldström 30 Game Theory: An Infinite Game against Chaos

Slide 31

Slide 31 text

© 2022 Lucas Käldström 31 Key Takeaways a) Systems are inevitably becoming less ordered, and thus b) need some periodic corrective action to steer the course towards c) some declared desired state of the system.

Slide 32

Slide 32 text

© 2022 Lucas Käldström 32 The 4 Whys: 1. The control plane is for Coordination, yet allows Improv 2. Declarativeness is for Portability and Desired State 3. Periodic action is for fighting inevitable Chaos

Slide 33

Slide 33 text

© 2022 Lucas Käldström 33 The world is much more random than we believe

Slide 34

Slide 34 text

Google Finding: “Failure is the Norm”

Slide 35

Slide 35 text

“deliberately leave significant headroom for workload growth, occasional ‘black swan’ events, load spikes, machine failures, hardware upgrades, and large-scale partial failures (e.g., a power supply bus duct)” Source: (Verma et. al., 2015) Google Finding: “Failure is the Norm”

Slide 36

Slide 36 text

© 2022 Lucas Käldström 36 Randomness is Unintuitive A procedure fails only once in 10000 runs (estimate) => 99.99% success probability Runs 10 times a day

Slide 37

Slide 37 text

Problems hiding in plain sight It just takes longer for small-scale users to notice problems due to e.g. randomness

Slide 38

Slide 38 text

Calling a Taxi is Declarative

Slide 39

Slide 39 text

© 2022 Lucas Käldström 39

Slide 40

Slide 40 text

© 2022 Lucas Käldström 40

Slide 41

Slide 41 text

© 2022 Lucas Käldström 41 Actuators, or reconcile loops, fulfil the claim(s) Observe and diff Desired State Source Target System 2 1 2: Actual State 1: Desired State

Slide 42

Slide 42 text

© 2022 Lucas Käldström 42 Actuators, or reconcile loops, fulfil the claim(s) Observe and diff Act Desired State Source 3 Target System 2 1 2: Actual State 1: Desired State 3: Action Plan

Slide 43

Slide 43 text

© 2022 Lucas Käldström 43 Actuators, or reconcile loops, fulfil the claim(s) Observe and diff Act Desired State Source 3 Target System 2 1 2: Actual State 1: Desired State 4: Action 3: Action Plan 4

Slide 44

Slide 44 text

© 2022 Lucas Käldström 44 Actuators, or reconcile loops, fulfil the claim(s) Observe and diff Act Desired State Source 3 Report (Actual State Sink) Target System 2 1 2, 6: Actual State 1: Desired State 4: Action 3: Action Plan 5: Result 4 5 (6)

Slide 45

Slide 45 text

© 2022 Lucas Käldström 45 Actuators, or reconcile loops, fulfil the claim(s) Observe and diff Act Desired State Source 3 Report (Actual State Sink) Target System 2 1 7: Requeue 2, 6: Actual State 1: Desired State 4: Action 3: Action Plan 5: Result 4 5 (6) 7

Slide 46

Slide 46 text

© 2022 Lucas Käldström 46 A taxi driver as a reconcile loop A taxi driver is approached by person P. 1. Ask where P wants to go, e.g. the City “desired state” 2. Ask where P is, e.g. Fira Valencia “actual state” 3. Figure out a route plan “action plan” 4. Drive P from Fira Valencia to the City “action” 5. Was the drive successful? “result” 6. Photograph P for a social media update “actual state sink” 7. Find the next client “requeue”

Slide 47

Slide 47 text

© 2022 Lucas Käldström 47 The 4 Whys: 1. The control plane is for Coordination, yet allows Improv 2. Declarativeness is for Portability and Desired State 3. Periodic action is for fighting inevitable Chaos 4. Designing controllers for failure is for Randomness

Slide 48

Slide 48 text

Operators: Encode human-like knowledge

Slide 49

Slide 49 text

= Automated reconcile loops with “human-like” operational knowledge Coined in 2016 by Brandon Phillips, back then at CoreOS Operators: Encode human-like knowledge

Slide 50

Slide 50 text

Not: Humans Operating Machines

Slide 51

Slide 51 text

Instead: Humans Operating Automation that in turn Operate Machines

Slide 52

Slide 52 text

Further Reading

Slide 53

Slide 53 text

© 2022 Lucas Käldström 53 Check out my thesis for more details! Available openly on Github: https://github.com/luxas/research CC-BY-SA 4.0 licensed Encoding human-like operational knowledge using declarative Kubernetes operator patterns

Slide 54

Slide 54 text

© 2022 Lucas Käldström 54 Control Theory (Vallery Lancery, QCon, 2018)

Slide 55

Slide 55 text

© 2022 Lucas Käldström 55 Promise Theory (The Kubernetes Documentary, Honeypot, 2022)

Slide 56

Slide 56 text

© 2022 Lucas Käldström 56 Wrap-up: The 4 Whys: 1. The control plane is for Coordination, yet allows Improv 2. Declarativeness is for Portability and Desired State 3. Periodic action is for fighting inevitable Chaos 4. Designing controllers for failure is for Randomness

Slide 57

Slide 57 text

Summary Baim Hanif on Unsplash Thank you! @luxas on Github @luxas on LinkedIn @luxas on SpeakerDeck @kubernetesonarm on Twitter [email protected]