Kubernetes Components in a Simplified way
Come meet the components that power Kubernetes clusters, explained through an fun city analogy with managers, foremen, workers and public services. Learn how they fit together to keep your cloud native apps running smoothly!
Understanding Kubernetes Components Under the Hood
So you want to learn Kubernetes? Great choice! As someone just getting started though, I remember feeling a bit overwhelmed trying to wrap my head around all the different components. It's like being handed a car engine and told to figure out how it works!
But not to worry - I'm going to break it down for you in simple terms. When you get a Kubernetes cluster, think of it like a small city. There are different machinery that powers everything behind the scenes.
Control Plane Components
First, you have "control plane" components - these are like the city planners making big decisions and keeping things running smoothly. The kube-apiserver
is like city hall, exposing a public interface and storing crucial data. Then etcd
is like a locked safe where all the most vital records are kept.
kube-apiserver
kube-apiserver
- Exposes the Kubernetes API which is the interface for administering objects/services and storing cluster data. It handles request routing and data for Kubernetes objects.
etcd
etcd
- A distributed key-value store that backs up all Kubernetes cluster data reliably. This is where all configuration data is stored and accessed.
kube-scheduler
kube-scheduler
- Watches for new pods and selects a cluster node for them to run on based on resource availability, policies, affinity rules, etc.
kube-controller-manager
kube-controller-manager
- Runs controllers that handle specific Kubernetes features:
- Node controller - Notices/handles node failures
- Job controller - Runs one-off tasks to completion
- EndpointSlice controller - Links services to pods
- ServiceAccount controller - Manages default accounts for namespaces
- cloud-controller-manager - Runs controllers specific to the cloud provider like node lifecycle handling and load balancer management.
Node Components
Next, we have "node" components that operate on every server. These are like the city workers that get stuff done! Kubelets
ensure everyone (or rather, every pod) is happy and taken care of. Kube-proxy
makes sure all residents can call and access whoever they need to. And container runtimes are like the housing construction crews, building safe places for processes to live and play.
kubelet
kubelet
- An agent on each node that receives pod definitions and ensures pods are started and running healthy.
kube-proxy
kube-proxy
- A network proxy on each node that maintains rules to allow networking access to pods from inside and outside the cluster.
Container runtime
Container runtime
- Software responsible for running containers (e.g. containerd) and managing their lifecycle.
Addons
There are other fun addons too like DNS, logging, and monitoring. Imagine these provide helpful public services for our little Kubernetes city!
DNS
DNS
- Cluster DNS serves DNS records for Kubernetes services and pods automatically get configured to use it.
Dashboard
Dashboard
- Web UI for managing/troubleshooting cluster resources and applications.
Resource Monitoring
Resource Monitoring
- Records metrics about cluster resources/containers and provides a browsing UI.
Cluster Logging
Cluster Logging
- Aggregates container logs into a central storage and search interface.
Network Plugins
Network Plugins
- Enable pod networking/communication via services like CNI plugins.
So in a nutshell, that's the gist of the main components that power Kubernetes under the hood. It may seem complex at first, but hopefully, this gives you an intuitive sense of how all the machinery fits together!