Skip to main content

Container Runtime Interface

The Container Runtime Interface (CRI) is the gRPC API the Kubernetes kubelet uses to talk to container runtimes such as containerd and CRI-O. It lets Kubernetes work with any compliant runtime.

What CRI standardises

Kubernetes does not start containers itself. The kubelet calls a runtime through CRI to pull images, create pod sandboxes, and start and stop containers. Any runtime that implements CRI can plug in, so Kubernetes is not tied to one vendor.

flowchart LR K[kubelet] -->|CRI gRPC| C[containerd or CRI-O] C --> R[runc] R --> P[Container process] classDef a fill:#DBEAFE,color:#1E293B classDef b fill:#D1FAE5,color:#1E293B class K a class C,R,P b

Why Docker support was removed in Kubernetes 1.24

Docker Engine does not implement CRI, so Kubernetes shipped a built-in adapter called dockershim. Maintaining it duplicated what containerd, which Docker itself uses, already offered through CRI. Kubernetes removed dockershim in version 1.24. Images built with Docker are OCI images and run unchanged on containerd or CRI-O. If you still need Docker Engine as a runtime, the separate cri-dockerd adapter exists.

Common CRI runtimes

  • containerd: the most common runtime, used by many managed Kubernetes services.
  • CRI-O: built specifically for Kubernetes, common in OpenShift.
  • gVisor and Kata Containers: sandboxed runtimes, selectable per workload through runtime classes.

Inspect the runtime

Bash
kubectl get nodes -o wide # CONTAINER-RUNTIME column: containerd://1.7.x
crictl ps # CRI-aware debugging on a node
crictl images
crictl logs <container-id>
Remember

You still build and push images with Docker. Only the node-level runtime changed.

Frequently Asked Questions

Why did Kubernetes need CRI?

Early Kubernetes had Docker-specific code in the kubelet. CRI defines one gRPC API so any compliant runtime can be used the same way, which decoupled Kubernetes releases from a single runtime.

Did removing dockershim break Docker-built images?

No. Docker images follow the OCI image format and run on containerd and CRI-O. Only the daemon used on the node changed, which matters mainly for workloads that mount the Docker socket.

How do I see which runtime my cluster uses?

Run kubectl get nodes -o wide and read the CONTAINER-RUNTIME column. On a node, crictl lets you list containers and images through CRI.

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