Kubernetes Container Runtime Internals: Understanding How containerd and CRI-O Work Behind the Scenes
Explore Kubernetes container runtime internals, understand how CRI works, and discover how containerd and CRI-O manage container images, isolation, and execution on Kubernetes worker nodes.

✍️ Translate this blog into Hindi, Tamil or Telugu
When a Pod starts in Kubernetes, several components work together behind the scenes to get its containers up and running. One of the first components involved in this process is the container runtime.
The container runtime is responsible for preparing the container environment, setting up isolation, and starting the application process. It acts as the bridge between Kubernetes and the underlying operating system, ensuring that containers run as expected.
Understanding how container runtimes work helps explain what happens behind the scenes when Kubernetes schedules and starts a Pod.
🛍️✨ From the author · ByteStoreAgentic AI For Devops Engineerโน15,000View offer →What Is a Container Runtime?
A container runtime is a system-level component responsible for managing the execution and lifecycle of containers on a Kubernetes worker node.
It performs several important tasks:
Pulling container images: Downloads the required container image from a container registry, such as Docker Hub or a private registry.
Unpacking and mounting image layers: Container images are typically built from multiple layers. The runtime extracts these layers and prepares them so the container can access its filesystem.
Creating isolated environments: Uses Linux features such as namespaces and control groups (cgroups) to isolate containers and manage their resource usage.
Namespaces provide isolation by giving containers their own views of system resources, such as processes, networks, and mount points.
cgroups control and monitor resource consumption, including CPU and memory.
Starting the container process: Uses a low-level container runtime, such as
runc, to create the container environment and execute its main application process.Reporting container status: Communicates container lifecycle information back to the Kubernetes kubelet, allowing Kubernetes to monitor container health and manage operations such as starting, stopping, and restarting containers.
Where Does the Container Runtime Fit into Kubernetes?
The container runtime runs on each Kubernetes worker node. It operates beneath the kubelet and communicates with it through the Container Runtime Interface (CRI).
The CRI is a standard interface that allows Kubernetes to work with different container runtimes without depending on a specific implementation.
In simple terms:
Kubelet tells the container runtime what containers need to be created, started, or stopped.
Container runtime performs these operations on the worker node.
Linux kernel provides the underlying features needed to run and isolate containers.
This separation allows Kubernetes to support multiple container runtime implementations while maintaining a consistent way to manage workloads.
Popular Container Runtime Types
Kubernetes supports several container runtime options that are compatible with the Container Runtime Interface (CRI). Each offers different capabilities, isolation levels, and operational trade-offs.
Here are some commonly used container runtimes and related technologies:
1. containerd
containerd is a lightweight, industry-standard container runtime widely used in Kubernetes environments.
It handles essential container operations, including:
Pulling and managing container images.
Managing image snapshots and container filesystems.
Creating and managing container lifecycle operations.
Working with low-level runtimes such as
runcto execute containers.
It is commonly used in managed Kubernetes platforms such as Google Kubernetes Engine (GKE), Amazon Elastic Kubernetes Service (EKS), and lightweight Kubernetes distributions such as k3s.
Its lightweight architecture and production-ready capabilities make it a popular choice for Kubernetes clusters.
2. CRI-O
CRI-O is a container runtime specifically designed to work with Kubernetes.
Unlike general-purpose container platforms, CRI-O focuses on providing the functionality Kubernetes needs through the CRI.
Its key characteristics include:
A minimal design focused on Kubernetes workloads.
Native support for the Container Runtime Interface.
Integration with low-level runtimes such as
runc.Support for managing container images and container lifecycles.
CRI-O is commonly used in Red Hat OpenShift and other Kubernetes environments where a Kubernetes-focused runtime is preferred.
3. Docker Engine
Docker Engine was historically one of the most widely used container platforms.
However, Kubernetes removed its built-in support for Docker Engine as a container runtime starting with Kubernetes v1.24.
This change did not mean that Kubernetes stopped supporting Docker-built container images.
Docker can still be used to build, package, and distribute container images. These images can then be run using CRI-compatible runtimes such as containerd or CRI-O.
The important distinction is that Docker Engine is no longer directly supported as a Kubernetes container runtime, but Docker-built images remain compatible with Kubernetes when they follow supported image standards.
4. gVisor
gVisor is a sandboxed container runtime that provides an additional layer of isolation between containers and the host operating system.
Instead of allowing applications to interact directly with the host kernel through the usual system-call path, gVisor implements much of the application-facing system-call interface in a user-space component.
This approach helps reduce direct exposure to the host kernel.
gVisor is particularly useful for:
🎓✨ From the author · Live trainingCloud & DevOps Live Cohort Internshipโน2,360See the training →Multi-tenant Kubernetes environments.
Running untrusted or third-party workloads.
Workloads that require stronger isolation than traditional containers provide.
5. Kata Containers
Kata Containers provides stronger workload isolation by running containers inside lightweight virtual machines.
Unlike traditional containers, which share the host operating system's kernel, Kata Containers uses a separate guest kernel inside a virtual machine for each sandbox.
This provides an additional isolation boundary between workloads and the host.
Kata Containers is particularly suitable for:
Security-sensitive applications.
Multi-tenant environments.
Workloads that require stronger isolation.
Environments where virtual machine-level isolation is preferred.
6. Mirantis Container Runtime (MCR)
Mirantis Container Runtime (MCR) is an enterprise-focused container runtime based on Docker Engine technology.
It provides commercially supported container infrastructure and enterprise-oriented management capabilities.
It is worth distinguishing MCR from the standard CRI-compatible runtimes commonly used by Kubernetes. Its use in Kubernetes depends on the supported integration and runtime configuration.
Did Kubernetes Drop Docker?
One common misconception is that Kubernetes completely stopped supporting Docker.
That is not entirely accurate.
Starting with Kubernetes v1.24, Kubernetes removed dockershim, the built-in component that allowed kubelet to communicate directly with Docker Engine.
This means Docker Engine can no longer be used directly through Kubernetes' built-in container runtime integration.
However, Docker-built images can still run perfectly well in Kubernetes.
For example:
A developer builds a container image using Docker.
The image is pushed to a container registry.
Kubernetes schedules a Pod onto a worker node.
The worker node's CRI-compatible runtime, such as
containerdor CRI-O, pulls and runs the image.
The key takeaway is that Docker is still useful for building container images, while containerd and CRI-O are commonly used to run those images inside Kubernetes.
Understanding Container Runtime Execution Flow
Now that we understand what container runtimes are and how they fit into Kubernetes, let's explore how they work internally.
Two of the most widely used runtimes in Kubernetes environments are:
CRI-O Runtime Flow
containerd Runtime Flow
Both implement the Container Runtime Interface and allow kubelet to manage containers. However, their internal architectures and component interactions differ.
Understanding these execution flows helps explain what happens behind the scenes when Kubernetes creates and starts a container.
🛍️ Sourabh Bhoyar's shelf
Courses, cohorts and more from the authorGet Sourabh Bhoyar's next blog by email
One email a week when they publish. Add the weekly Best of ByteBlog too. No spam, unsubscribe with one click.
We email you once to confirm. By subscribing you agree to the privacy policy.


💬 Comments (0)
Top · NewestSign in to comment