Demystifying Kubernetes Runtime: From Docker to CRI‑O and Kata
This article explains the evolution and inner workings of Kubernetes container runtimes, covering the classic Docker‑based flow, the roles of CRI, OCI, containerd, CRI‑O, and strong‑isolation solutions like Kata, gVisor, and Firecracker, while clarifying why the architecture became so layered.
Typical K8s Runtime Architecture
When kubelet needs to create a container it follows these steps:
Kubelet calls dockershim via the CRI gRPC interface, acting as a CRI client.
dockershim translates the request into a Docker Daemon command.
Docker Daemon forwards the request to containerd, which actually creates the container.
containerd spawns a containerd‑shim process to become the container’s parent, preserving state and stdin.
The shim uses the OCI runtime (runC) to set up namespaces, cgroups and mount the root filesystem.
runC launches the container and exits; the shim remains to collect the container’s status and clean up.
The original Docker‑only design was simpler: kubelet called Docker Daemon directly, which used libcontainer. Political and technical pressures led to the Open Container Initiative (OCI) and the Container Runtime Interface (CRI) to avoid vendor lock‑in.
Container History
Early Kubernetes used Docker directly. The desire for a vendor‑neutral runtime spurred the creation of OCI (defining ImageSpec and RuntimeSpec) and CRI (a set of gRPC interfaces for container and image operations and a PodSandbox).
OCI and CRI
OCI specifies how container images are packaged and which runtime commands must be supported. runC is the reference OCI runtime implementation.
CRI defines three core interface groups: container lifecycle, image lifecycle, and PodSandbox management.
containerd and CRI‑O
containerd 1.0 used a separate CRI‑containerd process:
containerd 1.1 integrated the CRI logic as a plugin, removing the extra process:
CRI‑O is a lightweight CRI‑compatible runtime that directly implements OCI without the Docker layer.
Strong‑Isolation Containers
Projects such as Kata Containers, gVisor and Firecracker provide VM‑based isolation. Kata runs each container inside a lightweight VM, preserving OCI compatibility while offering stronger security boundaries.
gVisor implements a user‑space “Sentry” process to handle syscalls, whereas Firecracker is a microVM built in Rust that minimizes virtualization overhead.
These solutions address Kubernetes’ multi‑tenant challenges by isolating workloads at the kernel level rather than sharing the host kernel.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
