containerd 是通用容器运行时,生态最广,Docker 和大多数 Kubernetes 发行版都用它;CRI-O 是专为 Kubernetes CRI 设计的轻量运行时,OpenShift 等平台常用。通用/生态优先 containerd,K8s 专用/轻量优先 CRI-O。
| 维度 | containerd | CRI-O |
|---|---|---|
| 定位 | 通用容器运行时 | Kubernetes 专用 CRI |
| 使用方 | Docker、K8s、其他 | Kubernetes/OpenShift |
| CLI | ctr/crictl/nerdctl |
crictl/crio |
| 配置 | /etc/containerd/config.toml |
/etc/crio/crio.conf |
| 镜像/存储 | 通用 | 面向 K8s |
| 生态 | 最广 | OpenShift 生态强 |
| 典型场景 | 通用节点 | 专用 K8s 节点 |
crictl info
crictl ps -a
crio --version
containerd --version
ctr 默认 namespace 不是 k8s.io;排查时加 -n k8s.io。containerd / crictl — containerdcrio / crictl — CRI-Okubectl — 节点与 Pod 状态