Changing the Container Runtime on a Node from Docker Engine to containerd

    Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren’t responsible for these projects, which are listed alphabetically. To add a project to this list, read the before submitting a change. More information.

    Install containerd. For more information see and for specific prerequisite follow the containerd guide.

    Drain the node

    Replace with the name of your node you are draining.

    1. systemctl stop kubelet
    2. systemctl disable docker.service --now

    Install Containerd

    Follow the guide for detailed steps to install containerd.

    1. Install the containerd.io package from the official Docker repositories. Instructions for setting up the Docker repository for your respective Linux distribution and installing the containerd.io package can be found at .

    2. Configure containerd:

      1. containerd config default | sudo tee /etc/containerd/config.toml
      1. sudo systemctl restart containerd

    Start a Powershell session, set $Version to the desired version (ex: $Version="1.4.3"), and then run the following commands:

    1. Download containerd:

    2. Extract and configure:

      1. Copy-Item -Path ".\bin\" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
      2. cd $Env:ProgramFiles\containerd\
      3. # Review the configuration. Depending on setup you may want to adjust:
      4. # - the sandbox_image (Kubernetes pause image)
      5. # - cni bin_dir and conf_dir locations
      6. Get-Content config.toml
      7. Add-MpPreference -ExclusionProcess "$Env:ProgramFiles\containerd\containerd.exe"
    3. Start containerd:

      1. .\containerd.exe --register-service
      2. Start-Service containerd

    Edit the file /var/lib/kubelet/kubeadm-flags.env and add the containerd runtime to the flags. and --container-runtime-endpoint=unix:///run/containerd/containerd.sock.

    Users using kubeadm should be aware that the kubeadm tool stores the CRI socket for each host as an annotation in the Node object for that host. To change it you can execute the following command on a machine that has the kubeadm /etc/kubernetes/admin.conf file.

    1. kubectl edit no <node-name>
    • Change the value of kubeadm.alpha.kubernetes.io/cri-socket from /var/run/dockershim.sock to the CRI socket path of your choice (for example unix:///run/containerd/containerd.sock).

      Note that new CRI socket paths must be prefixed with unix:// ideally.

    • Save the changes in the text editor, which will update the Node object.

    Restart the kubelet

    Run kubectl get nodes -o wide and containerd appears as the runtime for the node we just changed.

    Remove Docker Engine

    Note: This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren’t responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change.

    Finally if everything goes well, remove Docker.

    1. sudo yum remove docker-ce docker-ce-cli
    1. sudo dnf remove docker-ce docker-ce-cli

    Caution: Docker’s instructions for uninstalling Docker Engine create a risk of deleting containerd. Be careful when executing commands.