You can remove edge nodes from a Container Service for Kubernetes (ACK) Edge cluster. This topic describes how to remove edge nodes.
Table of contents
Prerequisites
Precautions
When you remove a node, the pods 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. We recommend that you back up the data on nodes before you remove the nodes.
Nodes remain in the Unschedulable state when they are being removed.
You can remove only worker nodes. You cannot remove master nodes.
An ACK Edge cluster can contain two types of nodes: nodes in the cloud and edge nodes. You can remove both types of nodes at the same time.
You must retain at least one node in the cloud in an ACK Edge cluster.
We recommend that you remove nodes in the ACK console. If you want to run the
kubectl delete node
command to remove a node in the cloud, take note of the following limits:The node cannot be added to other ACK clusters after it is removed.
The Elastic Compute Service (ECS) instance on which the node is deployed is released after the node is removed.
Procedure
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the cluster that you want to manage and choose in the left-side navigation pane.
The procedure for removing nodes from a node pool in the cloud is different from the procedure for removing nodes from an edge node pool.
Node pool in the cloud
Click the name of the node pool in the cloud.
On the Nodes tab, select the node that you want to remove and click Remove. You can select Release ECS Instance and Drain Node at the same time. Read the usage notes, select I understand the above information and want to remove the node(s), and then click OK.
Release ECS Instance:
Only pay-as-you-go ECS instances are released.
Subscription ECS instances are automatically released after the subscriptions expire.
If you do not select Release ECS Instance, you are still charged for the ECS instances on which the nodes are deployed.
Drain Node: Select this option to migrate pods that run on the nodes to other nodes in the cluster. If you select this option, make sure that other nodes in the cluster have sufficient resources to host these pods. You can also run the
kubectl drain node-name [options]
command to migrate pods that run on the nodes to other nodes in the cluster.Notenode-name must be in the your-region-name.node-id format. Example: cn-hangzhou.192.168.1.123.
your-region-name specifies the region where the cluster that you want to manage is deployed.
node-id specifies the ID of the ECS instance where the node to be removed is deployed.
options specifies the optional parameters of the command. Example:
--force --ignore-daemonsets --delete-local-data
. You can run thekubectl drain --help
command to view help information.
Edge node pool
Click the name of the edge node pool.
In the lower part of the Overview tab, select the node that you want to remove and click Remove Node.
In the Remove Node panel, read the usage notes, select I understand the above information and want to remove the node(s), and then click OK.
You cannot release ECS instances or automatically drain nodes when you remove edge nodes from an edge node pool.
To ensure that the Kubernetes components on the edge node that you have removed are uninstalled, run the
Reset
command in Edgeadm to reset the edge node.wget http://aliacs-k8s-[region].oss-[region].aliyuncs.com/public/pkg/run/attach/[clusterVersion]/[arch]/edgeadm -O edgeadm; chmod u+x edgeadm; ./edgeadm reset
Parameter
Description
Example
region
The region ID of the cluster.
cn-hangzhou
clusterVersion
The Kubernetes version of the cluster.
1.22.15-aliyunedge.1
arch
The CPU architecture of the edge node.
amd64