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

Beyond Block Diagrams: Different Ways of Understanding K8s Architecture

Kim Schlesinger
November 01, 2021
47

Beyond Block Diagrams: Different Ways of Understanding K8s Architecture

Most introductory Kubernetes videos and blog posts use static block diagrams to illustrate the core components of Kubernetes and how they interact. These diagrams don’t convey the dynamic communication between the K8s control plane, nodes, and pods, and we owe it to ourselves and people new to the field more accurate and engaging ways of representing Kubernetes architecture. This talk will demonstrate a few different methods to visualize how Kubernetes components work together including a time-sequence diagram that models what happens when a user creates a pod using the Kubernetes command line tool, kubectl, and how to use Jaeger to see an http request move onto different nodes by traveling through a load balancer, to a service, and arriving at a specific pod. This talk is for people who are new to Kubernetes and want to understand how the system is designed, as well as experienced engineers who are curious about alternative ways of visualizing Kubernetes architecture.

Kim Schlesinger

November 01, 2021
Tweet

Transcript

  1. View Slide

  2. Kim Schlesinger, DigitalOcean
    Beyond Block Diagrams: Different Ways of
    Understanding K8s Architecture

    View Slide

  3. Hi, I’m Kim
    Developer Advocate
    Site Reliability Engineer
    JavaScript Developer
    Elementary School Teacher
    2018
    @kimschles
    Beyond Block Diagrams

    View Slide

  4. Cloud Native Generation
    Photo source: https://unsplash.com/photos/8iZG31eXkks
    @kimschles
    Beyond Block Diagrams

    View Slide

  5. “Any framework that you
    can hold as a mental
    representation of an
    external reality.”
    - What is a mental model? by Julia Clavien
    Mental Models
    Photo source: https://unsplash.com/photos/3KGF9R_0oHs
    @kimschles
    Beyond Block Diagrams

    View Slide

  6. From the Kubernetes Documentation, Kubernetes Components: https://kubernetes.io/docs/concepts/overview/components/
    @kimschles
    Beyond Block Diagrams

    View Slide

  7. Hire, train and retain early-career engineers with limited
    computing experience
    Why?
    @kimschles
    Beyond Block Diagrams

    View Slide

  8. Takeaways
    1. Create diagrams that show the passage of time
    2. Use distributed tracing technology as a learning tool
    3. Build 3D models of Kubernetes clusters
    Photo source: https://unsplash.com/photos/_gEKtyIbRSM
    @kimschles
    Beyond Block Diagrams

    View Slide

  9. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  10. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  11. Example
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  12. kubectl create -f pod.yaml
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  13. Time Sequence Diagram
    @kimschles
    Beyond Block Diagrams

    View Slide

  14. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  15. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  16. Distributed Tracing
    “Distributed tracing, also called distributed request
    tracing, is a method used to profile and monitor
    applications, especially those built using a
    microservices architecture.”
    - OpenTracing Project
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  17. Meow-Micro 🐈
    ● 2 go microservices
    ● The meow-client accepts
    requests via a REST API and
    uses GRPC to communicate
    with the meow-server
    ● Fernando Diaz at GitLab
    Example
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  18. curl http://143.244.209.228/meow -X POST -d '{"name": "Meow-Mixer"}'
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  19. @kimschles
    Beyond Block Diagrams
    From Setting up Distributed Tracing with OpenTelemetry & Jaeger in Kubernetes Ingress-NGINX by Fernando Diaz
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model

    View Slide

  20. Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    From Setting up Distributed Tracing with OpenTelemetry & Jaeger in Kubernetes Ingress-NGINX by Fernando Diaz
    Beyond Block Diagrams

    View Slide

  21. @kimschles
    Beyond Block Diagrams Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model

    View Slide

  22. @kimschles
    Beyond Block Diagrams
    Weaveworks kspan
    Example: rollout of a
    Deployment of two Pods
    From weaveworks-experiments/kspan: Turning Kubernetes Events into spans

    View Slide

  23. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  24. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  25. Example
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  26. kubectl create -f pod.yaml
    Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  27. Time Sequence Diagram | Distributed Tracing + Diagram | 3D Model @kimschles
    Beyond Block Diagrams

    View Slide

  28. Agenda
    1. Time Sequence Diagram
    2. Distributed Traces + Diagram
    3. 3D Model
    @kimschles
    Beyond Block Diagrams

    View Slide

  29. @kimschles
    Beyond Block Diagrams
    Recap

    View Slide

  30. “Any framework that you
    can hold as a mental
    representation of an
    external reality.”
    - What is a mental model? by Julia Clavien
    Mental Models
    Photo source: https://unsplash.com/photos/3KGF9R_0oHs
    @kimschles
    Beyond Block Diagrams

    View Slide

  31. Cloud Native Generation
    Photo source: https://unsplash.com/photos/8iZG31eXkks
    @kimschles
    Beyond Block Diagrams

    View Slide

  32. From the Kubernetes Documentation, Kubernetes Components: https://kubernetes.io/docs/concepts/overview/components/
    @kimschles
    Beyond Block Diagrams

    View Slide

  33. Takeaways
    1. Create diagrams that show the passage of time
    2. Use distributed tracing technology as a learning tool
    3. Build 3D models of Kubernetes clusters
    Photo source: https://unsplash.com/photos/_gEKtyIbRSM
    @kimschles
    Beyond Block Diagrams

    View Slide

  34. Hire, train and retain early-career engineers with limited
    computing experience
    Why?
    @kimschles
    Beyond Block Diagrams

    View Slide

  35. Resources
    Examples of Kubernetes Time Sequence Diagrams
    ● Writing custom Kubernetes Scheduler - My Fake Tardis
    ● A Sequential Breakdown of the Kubernetes Deployment Process-
    ContainerLabs
    Time Sequence Diagram Generator
    ● SequenceDiagram.org - UML Sequence Diagram Online Tool
    @kimschles
    Beyond Block Diagrams

    View Slide

  36. Resources
    Distributed Tracing with Jaeger and ingress-nginx
    ● Jaeger: open source, end-to-end distributed tracing
    ● OpenTracing - NGINX Ingress Controller
    Tutorial
    ● Setting up Distributed Tracing in Kubernetes with OpenTracing, Jaeger,
    and Ingress-NGINX by Fernando Diaz, @awkwardferny
    Diagram Tool
    ● LucidChart
    @kimschles
    Beyond Block Diagrams

    View Slide

  37. Resources
    kspan
    ● Traces from Events: A New Way to Visualise Kubernetes Activities - Bryan
    Boreham
    ● weaveworks-experiments/kspan: Turning Kubernetes Events into spans
    @kimschles
    Beyond Block Diagrams

    View Slide

  38. @kimschles

    View Slide

  39. View Slide