Kubelet in Kubernetes
The Kubelet is a Kubernetes component that runs on every worker node and is responsible for managing Pods and containers on that node.
It acts as the bridge between the Control Plane and the container runtime.
Main Responsibilities
- Registers the node with the Kubernetes cluster.
- Receives instructions to run Pods.
- Communicates with the container runtime to start/stop containers.
- Pulls required container images.
- Continuously monitors Pods and containers.
- Ensures containers remain healthy and running as expected.
- Reports node and Pod status to the Kube API Server.
Basic Flow
Kube Scheduler
↓
Kube API Server
↓
Kubelet
↓
Container Runtime
↓
Containers
The Kubelet does not decide which node a Pod runs on. That decision is made by the Kube Scheduler.
Kubelet and Container Runtime
When the Kubelet receives instructions to run a Pod, it communicates with the container runtime.
Kubelet
↓
Container Runtime
↓
Pull Image
↓
Start Container
↓
Monitor Container
Examples of container runtimes include containerd and CRI-O.
Installing Kubelet
Unlike some Control Plane components, the Kubelet must be installed on worker nodes.
A typical Kubelet configuration includes:
ExecStart=/usr/local/bin/kubelet \
--config=/var/lib/kubelet/kubelet-config.yaml \
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \
--kubeconfig=/var/lib/kubelet/kubeconfig \
--register-node=true \
--v=2
Configuration options can vary depending on the Kubernetes version and setup.
Verify Kubelet
Check whether the Kubelet process is running:
ps -aux | grep kubelet
We can also check the node from the Control Plane:
kubectl get nodes
Kubelet vs Scheduler
| Component | Responsibility |
|---|---|
| Kube Scheduler | Decides which node should run a Pod |
| Kubelet | Runs and manages the Pod on that node |
| Container Runtime | Actually runs the containers |
| API Server | Coordinates communication |
Key Takeaway
Kubelet = Node-level Pod manager.
The Kubelet runs on each worker node, manages Pods and containers through the container runtime, monitors their health, and reports their status to the Kubernetes API Server.