This page explains how to delete a node pool and a cluster.
Delete a node pool
To delete a cluster, you must first delete all of its node pools.
Console
In the Google Cloud console, go to the Google Kubernetes Engine clusters overview page.
Select the Google Cloud project that the cluster is in.
In the cluster list, select the name of the cluster, and then select View details in the side panel.
Select the Nodes tab to see a list of all the node pools.
Select a node pool from the list.
Near the top of the window, click
Delete.If the delete fails, follow the steps in the
gcloud
tab and add the--ignore-errors
flag to thegcloud container aws node-pools delete
command.
gcloud
Get a list of your node pools:
gcloud container aws node-pools list \ --cluster CLUSTER_NAME \ --location GOOGLE_CLOUD_LOCATION
Replace the following:
CLUSTER_NAME
: the name of the cluster that the node pool is attached toGOOGLE_CLOUD_LOCATION
: the Google Cloud location hosting the node pool
For each of your node pools, delete it with the following command:
gcloud container aws node-pools delete NODE_POOL_NAME \ --cluster CLUSTER_NAME \ --location GOOGLE_CLOUD_LOCATION
Replace the following:
NODE_POOL_NAME
: the name of the node pool to deleteCLUSTER_NAME
GOOGLE_CLOUD_LOCATION
If the command returns an error and the delete fails, you can force the deletion by running the command again with the
--ignore-errors
flag. This flag is available in version 1.29 and later.
How GKE on AWS protects workloads during node pool deletion
During node pool deletion, GKE on AWS performs graceful shut down on each node without honoring PodDisruptionBudget. It takes the following steps:
- Disable cluster autoscaler if it was enabled.
- Set up a deadline for the draining process. After this deadline, even if there are still Pod objects existing, GKE on AWS stops draining and proceeds to deleting underlying virtual machines. The default deadline is 5 minutes. For every 10 more nodes, 5 more minutes is added.
- Cordon all the nodes in the node pool.
- Before deadline is met, delete Pod objects in the node pool with best efforts.
- Delete all the underlying compute resources.
Delete a cluster
Before deleting a cluster, make sure that you have deleted all of its node pools.
Console
In the Google Cloud console, go to the Google Kubernetes Engine clusters overview page.
Select the Google Cloud project that the cluster is in.
In the cluster list, select the name of the cluster, and then select View details in the side panel.
Near the top of the window, click
Delete.If the delete fails, follow the steps in the
gcloud
tab and add the--ignore-errors
flag to thegcloud container aws clusters delete
command.
gcloud
To delete a cluster, run the following command:
gcloud container aws clusters delete CLUSTER_NAME \
--location GOOGLE_CLOUD_LOCATION
Replace the following:
CLUSTER_NAME
: the name of the cluster to deleteGOOGLE_CLOUD_LOCATION
: the Google Cloud location hosting this clusterIf the command returns an error and the delete fails, you can force the deletion by running the command again with the
--ignore-errors
flag. This flag is available in version 1.29 and later.
What's next
- For more information, see the
gcloud container aws clusters delete
documentation.