Migrating Nodes from Docker to containerd
Context
Kubernetes has removed dockershim from v1.24 and does not support Docker by default. CCE will continue to support Docker in v1.25 but just till v1.27. The following steps show you how to migrate nodes from Docker to containerd.
Prerequisites
- At least one cluster that supports containerd nodes has been created..
- There is a Docker node or Docker node pool in your cluster.
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
- Log in to the CCE console and click the cluster name to access the cluster console.
- In the navigation pane, choose Nodes. In the node list, select one or more nodes to be reset and choose More > Reset Node.
- Set Container Engine to containerd. You can adjust other parameters as required or retain them as set during creation.
- 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.
- Log in to the CCE console and click the cluster name to access the cluster console.
- 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.
- On the Compute Settings area, set Container Engine to containerd and modify other parameters as required.
- 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.
- After the migration, delete the original Docker node pool.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot