Kubelet Explained: How the Kubernetes Node Agent Manages Pods & Containers

Kubelet is the primary node agent in Kubernetes that runs on every worker node (and sometimes control-plane node).

It ensures that containers are running as expected according to the Pod specifications provided by the Kubernetes API Server.

Kubelet Responsibilities

FunctionDescription
Pod Lifecycle ManagementStarts, monitors, and restarts containers as defined in Pod specs.
Container Runtime Interface (CRI)Interacts with container runtime (Docker, containerd, CRI-O).
Node RegistrationRegisters the node with the control plane and reports status.
Health ChecksPerforms liveness and readiness probes on containers.
Resource MonitoringReports CPU, memory, and disk usage to the control plane.
Pod Manifest WatchingWatches /etc/kubernetes/manifests/ for static Pod definitions.
Certificate RotationHandles node certificates for secure communication.
Logging & MetricsSends logs and metrics to monitoring systems (e.g., Prometheus).
Garbage CollectionRemoves unused containers and images to free resources.

How Kubelet Works (Flow Diagram)

  1. API Server → Node
    • The API server sends a PodSpec to the Kubelet on that node.
  2. Kubelet → Container Runtime (e.g., containerd)
    • Kubelet pulls container images and starts the containers.
  3. Kubelet → Control Plane
    • Reports back Pod and Node status (Running, CrashLoopBackOff, etc.).
  4. Kubelet Health Checks
    • Periodically probes containers and restarts if needed.
  5. Node Heartbeat
    • Sends node health and resource usage updates to the control plane.

What Happens When You Deploy a Pod

kubectl apply -f nginx-pod.yaml
  1. The API server receives the Pod definition.
  2. The Scheduler assigns the Pod to a Node.
  3. The Kubelet on that node:
    • Pulls the Nginx image.
    • Starts the container via containerd.
    • Runs readiness/liveness probes.
    • Reports Pod status (Running) to API server.

If Nginx crashes — the Kubelet restarts it automatically (self-healing).

Business Use Cases of Kubelet

Use CaseDescriptionBusiness Impact
Self-Healing InfrastructureKubelet restarts failed containersReduces downtime
Automated ScalingWorks with Horizontal Pod AutoscalerHandles traffic spikes
Observability & ComplianceReports resource usage and statusCost visibility and compliance
Secure Node CommunicationTLS + Webhook AuthProtects internal traffic
Hybrid Cluster ManagementKubelet abstracts node OS differencesRuns on AWS EC2, bare metal, or on-prem
Static Pods for Core ComponentsKeeps control-plane pods running even if API is downEnsures high availability

Troubleshooting Tips

IssueCommand / Fix
Kubelet not runningsystemctl restart kubelet
Pod stuck in PendingCheck kubectl describe pod <pod> — may be a node scheduling issue
Node NotReadyCheck journalctl -u kubelet and kubectl describe node
Connection refused on port 10250Validate TLS certificates and kubelet config
Container not startingCheck container runtime logs (sudo journalctl -u containerd)

Summary

AspectDescription
Component TypeNode agent
Runs OnEvery Kubernetes node
PurposeEnsure desired containers are running
CommunicationTalks to API server and container runtime
Critical Ports10250 (secure API), 10255 (deprecated)
Key FeaturesHealth checks, restart, metrics, node registration
Business ValueSelf-healing, scalable, automated container management

Kubelet is the heartbeat of a Kubernetes node — it ensures containers match the desired state, recovers from failures, and securely communicates with the control plane to keep workloads healthy and compliant.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *