Chapter 11. Understanding Kubernetes internals


This chapter covers

  • What components make up a Kubernetes cluster
  • What each component does and how it does it
  • How creating a Deployment object results in a running pod
  • What a running pod is
  • How the network between pods works
  • How Kubernetes Services work
  • How high-availability is achieved

By reading this book up to this point, you’ve become familiar with what Kubernetes has to offer and what it does. But so far, I’ve intentionally not spent much time explaining exactly how it does all this because, in my opinion, it makes no sense to go into details of how a system works until you have a good understanding of what the system does. That’s why we haven’t talked about exactly how a pod is scheduled or how the various controllers running inside the Controller Manager make deployed resources come to life. Because you now know most resources that can be deployed in Kubernetes, it’s time to dive into how they’re implemented.

11.1. Understanding the architecture

Before you look at how Kubernetes does what it does, let’s take a closer look at the components that make up a Kubernetes cluster. In chapter 1, you saw that a Kubernetes cluster is split into two parts:

  • The Kubernetes Control Plane
  • The (worker) nodes

Let’s look more closely at what these two parts do and what’s running inside them.

Components of the Control Plane

11.1.1. The distributed nature of Kubernetes components

11.1.2. How Kubernetes uses etcd

11.1.3. What the API server does

11.1.4. Understanding how the API server notifies clients of resource changes

11.1.5. Understanding the Scheduler

11.1.6. Introducing the controllers running in the Controller Manager

11.1.7. What the Kubelet does

11.1.8. The role of the Kubernetes Service Proxy

11.1.9. Introducing Kubernetes add-ons

11.1.10. Bringing it all together

11.2. How controllers cooperate

11.2.1. Understanding which components are involved

11.2.2. The chain of events

11.2.3. Observing cluster events

11.3. Understanding what a running pod is

11.4. Inter-pod networking

11.4.1. What the network must be like

11.4.2. Diving deeper into how networking works

11.4.3. Introducing the Container Network Interface