Skip to content

CRI-O — the lean container runtime for Kubernetes

Run CRI-O as the container runtime under kubelet — designed specifically for the Kubernetes CRI, minimal surface area, and tight OCI/CNI integration.

CRI-O is a container runtime built for exactly one job: implementing the Kubernetes Container Runtime Interface (CRI) and nothing else. Where containerd grew out of Docker and carries the genealogy with it, CRI-O was designed from scratch with the CRI spec as the public API and the OCI runtime spec as the private one. The result is a smaller binary, a smaller attack surface, and behaviour that maps 1:1 to what kubelet expects.

How to verify

A working CRI-O install responds to these probes:

crio --version
crictl info | jq '{runtimeVersion, runtimeApiVersion, cniconfig}'
systemctl is-active crio
ls /etc/cni/net.d/
ls /etc/crio/crio.conf.d/
crictl ps

The Kubernetes-facing socket is /var/run/crio/crio.sock. The crictl tool is the operator-facing CLI — kubectl get pods ultimately translates into crictl-style calls against this socket via kubelet’s CRI client.

What’s happening

CRI-O is a daemon that listens on a Unix socket for CRI-protocol requests from kubelet. When kubelet says “run pod X with these containers”, CRI-O does five things: pulls the images via its image manager (which uses the same containers/image library as Podman and Skopeo), unpacks them into containers/storage, asks the OCI runtime (runc or crun) to start them, wires up networking via CNI plugins, and registers the resulting pod with conmon (one conmon process per container, holding the container’s stdio and exit code).

The conmon model matters operationally. Because conmon owns the container’s lifecycle (not CRI-O itself), CRI-O can be restarted without disturbing running containers. This is a different design choice from Docker (where dockerd owns the lifetimes) and matches Podman’s approach.

CNI integration is first-class. CRI-O reads /etc/cni/net.d/*.conf directly and invokes the configured plugin chain when a sandbox is created. There is no built-in networking — you bring Calico, Cilium, Flannel, or whatever else your cluster runs.

The procedure

  1. Add the CRI-O apt repository. The version must match the kubelet major+minor version exactly — CRI-O does not promise CRI compatibility across mismatched versions:
K8S_VERSION=v1.30
CRIO_VERSION=v1.30

curl -fsSL https://pkgs.k8s.io/addons:/cri-o:/stable:/$CRIO_VERSION/deb/Release.key \
  | sudo gpg --dearmor -o /etc/apt/keyrings/cri-o-apt-keyring.gpg

echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://pkgs.k8s.io/addons:/cri-o:/stable:/$CRIO_VERSION/deb/ /" \
  | sudo tee /etc/apt/sources.list.d/cri-o.list

sudo apt-get update
sudo apt-get install -y cri-o
  1. Configure CRI-O for the cluster’s networking choice. Drop-in files in /etc/crio/crio.conf.d/ override the defaults. A common production override:
# /etc/crio/crio.conf.d/10-runtime.conf
[crio.runtime]
default_runtime = "crun"
pids_limit = 4096
log_size_max = 52428800

[crio.runtime.runtimes.crun]
runtime_path = "/usr/bin/crun"
runtime_type = "oci"
runtime_root = "/run/crun"

Switching the default runtime to crun (instead of runc) buys you faster container startup and lower memory overhead — crun is the C rewrite of runc.

  1. Enable and start the daemon:
sudo systemctl enable --now crio
sudo systemctl status crio
sudo journalctl -u crio --since "5 minutes ago"
  1. Tell kubelet to use CRI-O by setting the container runtime endpoint. On a kubeadm-managed node, this lives in /var/lib/kubelet/kubeadm-flags.env:
echo 'KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/crio/crio.sock"' \
  | sudo tee /var/lib/kubelet/kubeadm-flags.env

sudo systemctl restart kubelet
  1. Verify CRI-O is now what kubelet talks to. Inside the cluster:
kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.containerRuntimeVersion}'
# expected: cri-o://1.30.0
  1. For debugging, use crictl (not docker, not podman). It maps onto the CRI socket and is the right tool for “what is kubelet actually seeing”:
sudo crictl pods
sudo crictl ps -a
sudo crictl images
sudo crictl logs <container-id>
sudo crictl inspect <container-id>

Common pitfalls

  • Mismatching CRI-O minor versions with kubelet. CRI compatibility is only guaranteed within the same minor release. A kubeadm upgrade to v1.31 requires CRI-O v1.31 on every node first.
  • Leaving cgroup_manager at its default systemd when the rest of the kubelet/cluster expects cgroupfs, or vice versa. Mismatched cgroup managers produce silent pod-creation failures.
  • Forgetting that CRI-O’s image store is at /var/lib/containers/storage (not /var/lib/docker/). Disk-full alarms aimed at the wrong path miss the actual problem.
  • Trying to use docker CLI commands on a CRI-O node. There is no Docker daemon — use crictl or migrate operator habits to it.
  • Running CNI plugins that expect Docker’s network mode. Most modern CNI implementations (Calico, Cilium) work fine, but legacy stacks that rely on docker0/bip behaviour break.

Stack Harbor runs CRI-O as the runtime for client Kubernetes clusters where minimising the runtime’s surface area matters — see managed operations for the per-cluster version pinning, the cgroup-manager standardisation across the node pool, and the crun-by-default tuning we apply.