Delete a registered cluster
When you no longer need a registered cluster, delete it in the Container Service for Kubernetes (ACK) console. On the deletion page, review the resources to be released and select the ones that you want to retain.
Rules for cluster deletion and node release
When you delete a cluster, ACK releases the nodes by sequentially deleting their node pools. The following rules apply to node pools in the cluster:
If a node pool is configured with a desired number of nodes: All Pay-As-You-Go nodes in the node pool are released. Subscription nodes are not released. To release Subscription nodes, log on to the Elastic Compute Service (ECS) console, convert the Subscription nodes to Pay-As-You-Go nodes, and then release the nodes in the ECS console. After a node is released, its system disk is also released.
If a node pool is not configured with a desired number of nodes: Subscription nodes and any nodes that were manually or automatically added to the node pool are not released. All other nodes are released.
For more information, see How do I determine if a node pool has a desired number of nodes configured?
Prerequisites
Make sure that deletion protection is disabled for the cluster. If deletion protection is enabled, ACK prevents the deletion and prompts you to disable deletion protection before you can delete the cluster. For instructions, see How do I disable deletion protection for a cluster?
Procedure
Step 1: (Optional) Disconnect the target cluster
This optional step removes the ack-cluster-agent deployment from the target cluster, which removes the target cluster from the registered cluster. Use either the console or the CLI.
Disconnect the target cluster by using the console
Log on to the ACK console. In the left-side navigation pane, choose Clusters.
On the Clusters page, click the name of your cluster. In the left-side navigation pane, choose Workloads > Deployments.
On the Deployments page, set Namespace to
kube-system, findack-cluster-agent, and then choose More > Delete on the right.
Disconnect the target cluster by using the CLI
Run the following kubectl command on the target cluster to remove it from the registered cluster:
kubectl delete deploy ack-cluster-agent -n kube-systemStep 2: Delete the registered cluster in the console
Deleting a cluster releases the resources that you select on the deletion page. Read the on-screen notices about resource deletion and billing carefully before you proceed.
Log on to the ACK console. In the left-side navigation pane, choose Clusters.
On the Clusters page, choose More > Delete to the right of the cluster that you want to delete.
In the cluster deletion panel, review the resources that are deleted automatically, such as ECS, Elastic Container Instance (ECI), and ACS resources, and select the resources that you want to retain. Then complete the deletion as prompted.
After the deletion completes, the cluster no longer appears in the cluster list. If the deletion fails, the cluster status changes to delete_failed. For troubleshooting, see What if cluster deletion fails?
FAQ
What if cluster deletion fails?
If cluster deletion fails, its status changes to delete_failed.
Deletion can fail for the following reasons:
Abnormal resource dependencies
When you delete an ACK cluster, ACK releases the resources that you selected for deletion. ACK checks for resource dependencies during this process. For example, if a resource to be deleted has dependencies that were not created by the cluster, the deletion may fail. Click View in the Cluster Status column to see the cause of the failure. After you resolve the issue, try deleting the cluster again.
For example, if a NAT gateway automatically created by the ACK cluster contains SNAT or DNAT entries that were not created by the cluster, the deletion may fail. Retain the NAT gateway during the deletion and then manually release the NAT resources after the cluster is deleted. Alternatively, follow the on-screen instructions to manually remove the blocking SNAT or DNAT entries, and then try to delete the cluster again.
Other causes
If the cluster deletion fails for other reasons, submit a ticket.
How do I disable deletion protection for a cluster?
If deletion protection is enabled for a cluster, a message prompts you to disable deletion protection before you delete the cluster. To disable deletion protection, perform the following steps:
Log on to the ACK console. In the left-side navigation pane, choose Clusters.
In the Actions column of the cluster list, choose More > Disable Deletion Protection, and then disable deletion protection as prompted.
How do I determine if a node pool has a desired number of nodes configured?
Log on to the ACK console. In the left-side navigation pane, choose Clusters.
On the Clusters page, click the name of the cluster. In the left-side navigation pane, choose Nodes > Node Pools.
Click the name of the node pool, click the Basic Information tab, and then check whether the desired number of nodes is enabled in the Scaling Configurations section.
If the desired number of nodes is enabled, the section displays both Expected Nodes and Actual Nodes with their values.
Are fees charged when a cluster is being deleted or fails to be deleted?
When a cluster is in the deleting or delete_failed state, no cluster management fee or node management fee is charged. However, Alibaba Cloud still charges the resource fees generated by other cloud products. For more information about the cluster lifecycle, see cluster lifecycle. For the billing description of registered clusters, see Billing of cloud resources for registered clusters.
How is a registered cluster billed when it is in the abnormal inactive or unavailable state?
When a cluster is in the inactive or unavailable state, the related cluster management fee and cloud product resource fees continue to be charged. For the detailed billing description, see Billing of cloud resources for registered clusters.
In which lifecycle states is a cluster not charged a cluster management fee?
When a cluster is in the initial, failed, deleting, delete_failed, or deleted state (the deleted state is not visible to you), no cluster management fee is charged. However, Alibaba Cloud still charges the resource fees generated by other cloud products. For more information about the cluster lifecycle, see cluster lifecycle. For the billing description of registered clusters, see Billing of cloud resources for registered clusters.