Skip to main content

Kubelet

The kubelet is the primary agent on every Kubernetes node. It receives pod specifications from the API server, has the container runtime start the containers, runs health probes, and reports node and pod status back to the control plane.

What the kubelet does

The kubelet runs a continuous reconciliation loop comparing desired pod state with what is actually on its node. It does not run containers itself. It asks a runtime such as containerd through the Container Runtime Interface (CRI).

flowchart TD A["API server
PodSpecs"] --> K["Kubelet
on each node"] K -->|"CRI calls"| R["containerd"] R --> P["Running containers"] K -->|"status and heartbeats"| A classDef ctl fill:#475569,color:#ffffff classDef agent fill:#326CE5,color:#ffffff classDef rt fill:#D1FAE5,color:#1E293B class A ctl class K agent class R,P rt

Responsibilities

  • Pull images and start containers through the runtime.
  • Run liveness, readiness, and startup probes.
  • Mount volumes and manage pod lifecycle.
  • Report node conditions and pod status.
  • Evict pods when the node is short of memory or disk.

Probes

Probe Failure result
Liveness Container is restarted
Readiness Pod removed from Service endpoints
Startup Delays other probes until the app has started

Check a node

Bash
sudo systemctl status kubelet
sudo journalctl -u kubelet --since "10 minutes ago" | grep -E "ERROR|evict"
kubectl describe node mumbai-prod-node-2

Eviction thresholds

YAML
# /var/lib/kubelet/config.yaml
evictionHard:
memory.available: "200Mi"
nodefs.available: "10%"
evictionSoft:
memory.available: "500Mi"
evictionSoftGracePeriod:
memory.available: "1m30s"

Troubleshooting

Symptom Likely cause Fix
Node NotReady Kubelet crashed or lost the API Restart kubelet, check network
DiskPressure Images or logs filling disk Prune images, expand disk
Runtime is down containerd failed Restart containerd, then kubelet
Remember

If the kubelet stops, running containers usually keep running, but the node stops reporting. After the not-ready toleration period, the control plane evicts and reschedules its pods.

Security

The kubelet API on port 10250 can exec into pods. Require authentication and authorization and firewall the port.

Common Mistake

Rebooting a NotReady node without cordoning and draining it first, which kills pods without graceful termination.

Frequently Asked Questions

What does the kubelet do that the container runtime does not?

The kubelet is the node-level controller. It watches for pods assigned to its node, delegates container creation to the runtime, runs probes, mounts volumes, and reports status. The runtime only manages containers.

What happens to pods if the kubelet dies?

Containers already running continue, but health checks and status reporting stop. After the node is marked unreachable and the toleration period passes, the control plane reschedules the pods elsewhere.

How does the kubelet decide to evict a pod?

It compares node resources with configured thresholds. Under pressure it ranks pods by QoS class and usage relative to requests, evicting BestEffort and over-request Burstable pods first.

Found a mistake, an outdated step or a broken link?