Choosing a Container Runtime
TOC
Overview
Container Runtime is a core component of Kubernetes, responsible for managing the lifecycle of images and containers.
When creating clusters through the platform, you can choose either Containerd or Docker as your runtime component.
Note: Kubernetes version 1.24 and above no longer officially supports Docker runtime. The officially recommended runtime is Containerd. If you still need to use Docker runtime, you must first enable cri-docker in the feature gate before you can select Docker as the runtime component when creating a cluster. For details on using feature gates, see Feature Gate Configuration.
Quick Selection Guide
Differences Between Docker and Containerd
Common Commands
Call Chain Differences
-
Docker as Kubernetes container runtime has the following call relationship:
kubelet > cri-dockerd > dockerd > containerd > runC
-
Containerd as Kubernetes container runtime has the following call relationship:
kubelet > cri plugin (in containerd process) > containerd > runC
Summary: Although dockerd adds features like swarm cluster, docker build, and Docker API, it can introduce bugs and adds an extra layer in the call chain. Containerd has a shorter call chain, fewer components, greater stability, and consumes fewer node resources.