Help Center/ Cloud Container Engine/ User Guide (Ankara Region)/ Nodes/ Node O&M/ Migrating Nodes from Docker to containerd
Updated on 2024-12-04 GMT+08:00

Migrating Nodes from Docker to containerd

Context

Kubernetes has removed dockershim from v1.24 and does not support Docker by default. If you need to migrate Docker nodes to containered nodes, see the information provided in this section.

Prerequisites

Precautions

  • Theoretically, migration during container running will interrupt services for a short period of time. Therefore, it is strongly recommended that the services to be migrated have been deployed as multi-instance. In addition, you are advised to test the migration impact in the test environment to minimize potential risks.
  • containerd cannot build images. Do not use the docker build command to build images on containerd nodes. For other differences between Docker and containerd, see Container Engine.

Migrating a Node

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Nodes. On the displayed page, click the Nodes tab.
  3. In the node list, select one or more nodes to be reset and choose More > Reset Node in the Operation column.
  4. Set Container Engine to containerd. You can adjust other parameters as required or retain them as set during creation.

  5. If the node status is Installing, the node is being reset.

    When the node status is Running, you can see that the node version is switched to containerd. You can log in to the node and run containerd commands such as crictl to view information about the containers running on the node.

Migrating a Node Pool

You can copy a node pool, set the container engine of the new node pool to containerd, and keep other configurations the same as those of the original Docker node pool.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Nodes. On the Node Pools tab page, locate the Docker node pool to be copied and choose More > Copy in the Operation column.

  3. On the Compute Settings area, set Container Engine to containerd and modify other parameters as required.

  4. Scale the number of created containerd node pools to the number of original Docker node pools and delete nodes from the Docker node pools one by one.

    Rolling migration is preferred. That is, add some containerd nodes and then delete some Docker nodes until the number of nodes in the new containerd node pool is the same as that in the original Docker node pool.

    If you have set node affinity for the workloads deployed on the original Docker nodes or node pool, set affinity policies for the workloads to run on the new containerd nodes or node pool.

  5. After the migration, delete the original Docker node pool.