How Linux Runs Kubelet for Container Management

The Linux operating system manages the Kubernetes kubelet as a native host daemon that acts as the primary bridge between the cluster control plane and the node's underlying kernel. Operating typically under the control of an init system like systemd, the kubelet receives pod specifications, delegates container lifecycles to an OCI-compliant runtime via the Container Runtime Interface (CRI), and enforces resource limits by configuring Linux control groups (cgroups) and namespaces. This architecture ensures that workloads execute efficiently, maintain process isolation, and remain within assigned compute and memory boundaries on the host.

Service Initialization via systemd

In modern Linux distributions, the kubelet runs outside of containers directly on the host OS as a native binary managed by systemd. A dedicated unit file (usually located at /etc/systemd/system/kubelet.service or /usr/lib/systemd/system/kubelet.service) defines the execution environment, startup dependencies, and lifecycle policies.

Key interactions managed by systemd include:

Communication with the Container Runtime (CRI)

The kubelet does not directly spawn Linux containers. Instead, it relies on the Container Runtime Interface (CRI) to communicate with a low-level runtime.

The interaction follows a structured path:

  1. gRPC over UNIX Domain Sockets: The kubelet connects to runtimes like containerd or CRI-O using a local UNIX domain socket (for example, /run/containerd/containerd.sock).
  2. OCI Delegation: The high-level runtime translates the kubelet's CRI instructions into Open Container Initiative (OCI) specifications and invokes a low-level runtime (such as runc or crun).
  3. Kernel Primitives: The low-level runtime makes the necessary Linux system calls (clone, unshare, setns, pivot_root) to instantiate the container processes.

Kernel Isolation: Namespaces and cgroups

The primary mechanism by which the host Linux kernel enforces pod boundaries under kubelet guidance is through namespaces and control groups.

Resource Monitoring and Node-Pressure Eviction

The kubelet constantly inspects host and container resource utilization to protect the Linux host from instability:

Storage and Network Orchestration at the OS Level

To prepare an environment for container execution, the kubelet interacts directly with Linux storage and networking subsystems: