This topic describes how to remove nodes from a cluster of Alibaba Cloud Container Service for Kubernetes (ACK).
- When you remove nodes from an ACK cluster, you may need to migrate pods that run on these nodes to other nodes. This may cause service interruptions. We recommend that you remove nodes during off-peak hours.
- Unexpected errors may occur when you remove nodes. We recommend that you back up the data on these nodes before you remove the nodes.
- Nodes remain in the unschedulable state when they are being removed.
- You can remove only worker nodes.
- We recommend that you remove nodes in the ACK console. If you run the kubectl delete node command to remove nodes from an ACK cluster, note the following limits:
- The removed nodes cannot be added to other ACK clusters.
- The Elastic Compute Service (ECS) instances are automatically released after the nodes are removed.
- Log on to the ACK console.
- In the left-side navigation pane, click Clusters.
- On the Clusters page, click the name of the target cluster or click Manage in the Actions column.
- In the left-side navigation pane, click Nodes.
- On the Nodes page, find the target node and select in the Actions column.Note To remove multiple nodes at a time, select the target nodes on the Nodes page and click Batch Remove.
- Optional:In the Remove Node dialog box, select the Release ECS Instance and Drain the Node check boxes, and click OK.After the node is removed, the ECS instance where the node is deployed is released.
- Release ECS Instance:
- Select this option to release only pay-as-you-go ECS instances.
- Subscription ECS instances are automatically released after the subscription expires.
- If you do not select the Release ECS Instance check box, the system continues to bill the ECS instance where the target node is deployed.
- Drain the Node: Select this option to migrate pods that run on the removed nodes to other nodes
in the cluster. If you select this option, make sure that the other nodes in the cluster
have sufficient resources for these pods.
You can also run the
kubectl drain node-namecommand to migrate pods that run on removed nodes to other nodes in the cluster.Note node-name must be in the format of your-region-name.node-id.
- your-region-name specifies the region where the target cluster is deployed.
- node-id specifies the ID of the ECS instance where the target node is deployed. Example: cn-hanghzou.i-xxx.
- Release ECS Instance: