Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Understanding Kubernetes Through Real-World Phe...

Understanding Kubernetes Through Real-World Phenomena and Analogies

How is the Kubernetes controller model similar to a taxi driver? Why is Kubernetes so differently designed compared to similar systems? How has the second law of thermodynamics and randomness theory shaped Kubernetes design? How the shift from traditionally managing servers to using Kubernetes operators similar to the Industrial Revolution? This talk offers the audience a unique perspective into why Kubernetes is designed the way it is. Kubernetes is often described as designed from “decades of experience”, but it is not as often mentioned what that means in practice. Quite conversely, many newcomers to Kubernetes find it “too complex”. Why is it, or why is that the impression? After this talk, the audience can make sense out of why Kubernetes does what it does. This by learning the fundamental design philosophies of Kubernetes and cloud native through well-known phenomena and real-world analogies. With the right mental model, hopefully it doesn’t seem overwhelmingly complex anymore.

KubeCon talk recording: https://youtu.be/GpJz-Ab8R9M
Sched link: https://sched.co/ytr4
Location: Av. de les Fires, s/n, Pobles de l'Oest, 46035 València, Spain

Lucas Käldström

May 19, 2022
Tweet

More Decks by Lucas Käldström

Other Decks in Technology

Transcript

  1. Understanding Kubernetes Through Real-World Phenomena and Analogies Lucas Käldström -

    CNCF Ambassador May 19, 2022 – Valencia Image credit: CNCF
  2. © 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
  3. Problems hiding in plain sight It just takes longer for

    small-scale users to notice problems due to e.g. randomness
  4. © 2022 Lucas Käldström 14 The 4 Whys: 1. The

    control plane is for Coordination, yet allows Improv (Joe Beda, 2017)
  5. © 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)
  6. © 2022 Lucas Käldström 18 The Imperative - Declarative spectrum

    Importance Declarative Imperative What How
  7. © 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
  8. © 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:
  9. © 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
  10. © 2022 Lucas Käldström 25 Entropy: Putting order to chaos

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

    Time Entropy Order Start Stop Chaos Reversing, ordering process
  12. © 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.
  13. © 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
  14. “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”
  15. © 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
  16. Problems hiding in plain sight It just takes longer for

    small-scale users to notice problems due to e.g. randomness
  17. © 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
  18. © 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
  19. © 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
  20. © 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)
  21. © 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
  22. © 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”
  23. © 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
  24. = Automated reconcile loops with “human-like” operational knowledge Coined in

    2016 by Brandon Phillips, back then at CoreOS Operators: Encode human-like knowledge
  25. © 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
  26. © 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
  27. Summary Baim Hanif on Unsplash Thank you! @luxas on Github

    @luxas on LinkedIn @luxas on SpeakerDeck @kubernetesonarm on Twitter [email protected]