This topic describes how to remove idle nodes from a Container Service for Kubernetes (ACK) cluster.
Prerequisites
- An ACK cluster is created. For more information, see Create an ACK dedicated cluster.
- A kubectl client is connected to the cluster. For more information, see Connect to ACK clusters by using kubectl.
Precautions
- When you remove a node, the pods that run on the node are migrated to other nodes. This may cause service interruptions. We recommend that you remove nodes during off-peak hours.
- Unknown errors may occur when you remove nodes. Before you remove nodes, back up the data on the nodes.
- Nodes remain in the Unschedulable state when they are being removed.
- You can remove only worker nodes. You cannot remove master 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, take note of the following limits:
- The removed nodes cannot be added to other ACK clusters.
- After you delete a cluster, the Elastic Compute Service (ECS) instances where the removed nodes are deployed are automatically released.
- If you use the ECS or Auto Scaling console or use the ECS or Auto Scaling API to remove nodes or release instances in a node pool, the node pool automatically scales to the expected number of nodes. A node pool also scales to the expected number of nodes when the subscription instances in the node pool expire and are automatically released. Therefore, if you want to change the number of nodes in a node pool, modify the expected number of nodes or manually remove nodes from the node pool in the ACK console.