How to switch from Docker to Containerd on a kubeadm-managed Kubernetes node:
-
Install Containerd.
-
Edit
/etc/default/kubeletand add the following line:KUBELET_EXTRA_ARGS=--container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sockIf
KUBELET_EXTRA_ARGSexists already, add the additional parameters to it instead. -
Restart
kubelet. -
Uninstall Docker.
-
To make
kubeadmaware of the change (so thatkubeadm upgrade applyworks): Let${NODE_NAME}be the name of your node. Run:kubeadm edit nodes/${NODE_NAME}Look for the
kubeadm.alpha.kubernetes.io/cri-socketannotation. Change its value to/run/containerd/containerd.sock.
Now everything should be set up for Containerd and you can do such fun things as running Kubernetes pods in Kata containers.
Presumably, these instructions will work for a migration to CRI-O and other container runtimes as well, but I have not tried.