Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Explaining Kubernetes To My Uber Driver
Jessica Wang
Jessica Wang

Posted on

     

Explaining Kubernetes To My Uber Driver

Image description

A week ago, I attended Kubecon 2023 in Chicago. I read a few blogs and attended some 101 tutorials at the conference, but still didn’t have a good understanding of the technology. The worst part was the last day of the conference - I ordered an Uber to bring me back to my hotel. My driver asked me “What’s the convention about?” to which I responded “It’s about Kubernetes", but after some explaining, it was clear I had no idea what I was talking about.

Imagine coming out of a 3 day conference, and not being able to describe the technology to your Uber driver.Facepalm. So, in an attempt to redeem myself, here’s my reimagined conversation with my Uber driver.

Start of Conversation

Me: Imagine you’re a chef at a busy restaurant kitchen. You’ve got a team of chefs working for you, and each one is preparing a different part of the meal - one group for appetizers, one for main courses, and another for desserts. Coordinating these chefs to make sure the meal is served to the customer on time is your job. You have a picture in your head?

Image description

Driver: Got it.

Me: In this scenario, the head chef is Kubernetes. Just like that head chef needs to manage all the different chefs in the kitchen, Kubernetes helps manage all the different pieces needed to run your software. The official definition of Kubernetes is a “container-orchestration tool”, but since the word “container” is pretty abstract here, you can substitute the word “container” for “chef”. So Kubernetes would be a "chef orchestration tool". That way, you can form a picture in your head of your kitchen every time you hear the word.

Image description

Driver: Okay, makes sense so far. But what are these containers? I can't keep imagining them as chefs forever.

Me: Yeah good point. So now that you have a picture in your head of your Kubernetes kitchen, let’s dive into how all the different kitchen roles map to Kubernetes concepts, going from smallest to largest.

Container
The smallest part of this puzzle is the container, and it’s basically any piece of software. For example, it could be a Node.js web server that hosts a web application, or a MongoDB database container to store data(this sentence is more for the engineers reading this blog, I wouldn’t say this to my Uber driver 😛). In the kitchen, imagine you’re serving soup and a salad for your appetizer. The soup would be your container. The salad would also be it’s own container.

I know this definition seems a bit arbitrary right now, but it’ll make more sense once I explain itin the context of the upcoming components.

Image description

Pod
In the kitchen, a pod would be the plate/tray that holds your soup and salad. In Kubernetes, a pod is something that can hold 1 or more containers. The reason for this is that containers within a pod can communicate with each other.

For the engineers: as an example, imagine I have a container for a web server and a container for a database in my pod. They can communicate with each other over localhost.

As for an appropriate analogy with the kitchen, I can’t really think of anything. Imagine some Sausage Party shenanigans where your anthropomorphized soup and salad start chatting to each other. But the soup and salad from the appetizer plate can’t talk to the steak and potatoes on the dinner plate because they are on different plates (aka, different pods don’t share the same network namespace and therefore can’t communicate with each other.)

Image description

Master Node
The head chef who manages and oversees the entire kitchen. This is that concept of “container orchestration” or “chef orchestration” we talked about earlier. Some real life examples of the orchestration work that this master node would do would be:

Scaling, aka adjusting up or down the number of running pods based on CPU utilization. In a busy kitchen, when there’s a surge in customer demand, chefs may need to scale up their operations by preparing more servings of a dish. By the way, one thing to note in this visualization - you’re probably imagining the kitchen hiring in new chefs, but I want you to imagine it more like the current chefs are getting cloned. When scaling happens, pods are essentially being copied.

Automated deployment, aka defining your application’s dependencies & runtime instructions in a YAML file so it can deploy based off this configuration. In a kitchen, this YAML file is analogous to a written recipe that tells the chef how to make the dish to ensure consistency and efficiency and preparing it.

Load balancing, aka distributing network traffic across different pods. In kitchen, load balancing involved assigning tasks to different chefs at a cooking station. Maybe Bob at the dessert station is overloaded with requests to scoop ice cream, so the master chef clones Bob and has Bob 2.0 take some of the ice cream orders off Bob 1.0’s hands.

Image description

Also important to note: each worker node has something called a "kubelet". In the kitchen scenario, "kubelet" would be analogous to the chef at each table. The chef has a bunch of jobs, like making sure the trays of food are being assembled correctly, helping prep ingredients, and throwing away the scraps. Similarly, "kubelet" does things like ensuring containers within pods are running, helps with initializing pods (e.g. have necessary dependencies installed), help with garbage collection, and more.

Some extra context for the engineers: Kubelet is an open-source, executable binary (aka file with machine code instructions that a CPU can directly execute), written in Go programming language.

Image description

Let's stop here for a second. If you understand everything I've said up to this point, you understand the basics of Kubernetes architecture! If you don't want to rely on the kitchen imagery forever, I've replaced all the kitchen drawings with only Kubernetes terminology in the diagram below.

Image description

Driver: Actually, all of this makes a lot of sense. So I get what Kubernetes is. But I still don't get why it's useful. Like what's the point of having it or learning about it?

Me: Yep, the last part of the puzzle is understandinghow Kubernetes is used. How do humans interact with Kubernetes? How is Kubernetes relevant/useful in the world of technology? Let's lean back on our kitchen analogy for a second to explain some more concepts.

  • The owner of the restaurant/franchise is analogous to the software developers that are building out an app or service. At McDonalds, the franchise owner (Let's say their name is Francis Cockadoodledoo) wants get information on how much money each McDonalds location is making, and have the ability to fire/hire employees as needed. To do this, Francis Cockadoodledoo may pick up their phone and call the master chef to get information and give orders. In Kubernetes, software engineers can't really pick up a phone to interact with their Kubernetes cluster, but the “master node” has an API server that you can call, and this allows you access all tasks. For example, engineers can get information on all the pods, nodes, services, understand the health and metrics information, and have the ability to delete or create resources.

  • The customers eating at the restaurant is analogous to the users of an app or service. Similar to how the Mcdonalds kitchen produces Big Macs for me to eat, the Spotify Kubernetes cluster is providing me the service of listening to a large selection of music from a web browser.

I've factored this new information into the drawing I've included below. What you'll see is actually very similar to the diagrams you'll see when you google "Kubernetes architecture".

Image description

A diagram of Kubernetes architecture I pulled from the Internet

And of course, I realize there are some abstractions I left out of my explanation because I felt like they were not important in forming a basic mental model of Kubernetes. Feel free to dig in more. As I dig in more myself, I may add to this blog with some links to resources I find useful.

Conclusion

The reason why I picked this mode of storytelling (describing tech through the lens of a conversation with an Uber driver) is because I wanted to break down Kubernetes into something that was universally understandable and felt approachable.

Thank you for reading! If you have anyconstructive feedback for improving my writing (or my shitty drawings), please leave them in the comments.

Enjoy this picture of me and my coworker at #Kubecon 2023. We were there to promote the product I work on, BTW.

If you're interested, you should check it out. It's a modern take on the outdate terminal (command line) experience & makes you a better developer. Go tohttps://www.warp.dev/ to learn more.

I'm on the left

Top comments(82)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
therubberduckiee profile image
Jessica Wang
I'm Dev Rel at startup (Warp.dev) that's building a modern-day terminal. I have a background as SWE (Microsoft, DoorDash) & enjoy fusing tech with my love for teaching and creating fun projects :)
  • Location
    Seattle, WA
  • Pronouns
    She/her
  • Work
    Warp.dev
  • Joined

To the people reading, I just want to say how clever I felt, when drawing out the title image, that "Kubernetes" already had the word "Uber" in it.

What a funny coincidence :)

CollapseExpand
 
mickymultani profile image
Micky Multani
Micky Multani is a distinguished leader in Enterprise Technology Risk, adept in harnessing the potential of emerging technologies like Artificial Intelligence, Machine Learning, and Blockchain.
  • Location
    Boston
  • Work
    Director, Risk Management @ Fidelity Investments
  • Joined

This was pretty neat actually!

CollapseExpand
 
pahujanayan profile image
Nayan Pahuja
Be Curious

Thanks for writing this beautiful article. I had been reading about and working with some practical kubernetes for a while now and this article just humbles me to my core about how simplified yet complete one can write. Great Read

CollapseExpand
 
bruc3mackenzi3 profile image
Bruce MacKenzie
I'm a software developer with a passion for building robust, quality, scalable solutions. My specialties are in backend applications, distributed systems, service-oriented architecture, to name a few
  • Location
    Toronto
  • Work
    Backend Software Developer
  • Joined

Great concept for an article! I appreciate the humility.

I have a suggestion to enrich the restaurant metaphor. First some nomenclature:

Thehead chef is the visionary behind the food. The Sous-chef is second in command to the head chef, and manages the kitchen on their behalf.

Kubernetes is Greek for helmsman. In sailing, the helmsman carries out the captains orders in navigating the ship.

In the sailing metaphor, Kubernetes is the helmsman and you are the captain. Extending the same metaphor to the kitchen, Kubernetes would be the Sous-chef and you are the head chef.

The idea here would be Kubernetes handles the gritty details of container orchestration, and provides a higher-level abstraction for you to orchestrate your containers. Put another way, you tell Kuberneteswhat actions to carry out and it does so, handling the complex details ofhow.

CollapseExpand
 
proteusiq profile image
Prayson Wilfred Daniel
🐝 everything command line | console.log(`ML | Data Science | Python`);
  • Location
    Copenhagen, Denmark
  • Education
    Aalborg University
  • Work
    🐙 Principal Data Scientist | _42 @ Norlys
  • Joined

Unique and brilliant explanation of what Kubernetes is. This is how we ought to explain complex ideas in relatable paradigms. 👏

CollapseExpand
 
oussamash profile image
Oussama Sh
  • Joined

Nice explanatory post in a funny way thanks!

CollapseExpand
 
phil_johnston profile image
Phil Johnston
I like to make things
  • Joined

This is the best explanation of kubernetes I’ve found. Thank you!

CollapseExpand
 
atulkhot profile image
Atul S Khot
A self taught developer - Started with C/C++ and Linux. Head over heels in love with Scala and Haskell. Have dabbled in scripting languages, DevOps and software architecture!
  • Location
    Pune, India
  • Work
    Software Architect at Squareone Insights
  • Joined

Awesome write-up 👌👍

CollapseExpand
 
michaeltharrington profile image
Michael Tharrington
I'm a friendly, non-dev, cisgender guy from NC who enjoys playing music/making noise, hiking, eating veggies, and hanging out with my best friend/wife + our 3 kitties + 1 greyhound.
  • Email
  • Location
    North Carolina
  • Education
    BFA in Creative Writing
  • Pronouns
    he/him
  • Work
    Senior Community Manager at DEV
  • Joined

This is such a creative and awesome post.

Fantastic analogy... and now I'm hungry, haha! 😋

CollapseExpand
 
danbailey profile image
Dan Bailey
Web dev from the 90's, turned project manager, turned full-stack web developer again. Bicycle-obsessed asshole. I also like books.
  • Location
    Minneapolis, MN
  • Education
    B.A. English (Creative Writing), Minnesota State University
  • Pronouns
    he/him/dude
  • Work
    Solutions Architect at Wings Financial Credit Union
  • Joined

This is fantastic. One of the best articles I've consumed on here.

CollapseExpand
 
therubberduckiee profile image
Jessica Wang
I'm Dev Rel at startup (Warp.dev) that's building a modern-day terminal. I have a background as SWE (Microsoft, DoorDash) & enjoy fusing tech with my love for teaching and creating fun projects :)
  • Location
    Seattle, WA
  • Pronouns
    She/her
  • Work
    Warp.dev
  • Joined

wow :O

CollapseExpand
 
seif_sekalala_81e09fe6b9e profile image
Seif Sekalala
A head-over-heels hopeless romantic lover of love, life-long learning, and coding! 😊
  • Location
    Philadelphia, PA
  • Education
    Drexel U.; Kean U.
  • Work
    Project-Manager & Software-Development/Engineering Trainee
  • Joined
• Edited on• Edited

This is SO funny (and cute—and I mean that respectfully, from the “kid at heart” inside me)! Best of all, it’s actuallyVERY effective, re: explaining Kubernetes! Good job, author [@therubberduckiee ]!
😂👍👏

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm Dev Rel at startup (Warp.dev) that's building a modern-day terminal. I have a background as SWE (Microsoft, DoorDash) & enjoy fusing tech with my love for teaching and creating fun projects :)
  • Location
    Seattle, WA
  • Pronouns
    She/her
  • Work
    Warp.dev
  • Joined

More fromJessica Wang

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp