This page explains how to delete a Google Kubernetes Engine cluster.
When you delete a cluster, the following resources are deleted:
- The master resources
- All of the node instances in the cluster
- Any Pods that are running on those instances
- Any firewalls and routes created by GKE at the time of cluster creation
- Data stored in host
The following resources are not deleted:
Before you begin
To prepare for this task, perform the following steps:
- Ensure that you have enabled the Google Kubernetes Engine API. Enable Google Kubernetes Engine API
- Ensure that you have installed the Cloud SDK.
- Set your default project ID:
gcloud config set project [PROJECT_ID]
- If you are working with zonal clusters, set your default compute zone:
gcloud config set compute/zone [COMPUTE_ZONE]
- If you are working with regional clusters, set your default compute region:
gcloud config set compute/region [COMPUTE_REGION]
gcloudto the latest version:
gcloud components update
Deleting a cluster
To delete a cluster using the
gcloud command-line tool, run
the following command:
gcloud container clusters delete [CLUSTER_NAME]
For more information, refer to the
gcloud container clusters delete
To delete a cluster using the GCP Console, perform the following steps:
Visit the Google Kubernetes Engine menu in GCP Console.
Click the Delete icon (it looks like a trash can) next to the cluster you want to delete.
- When prompted to confirm, click Delete again.
To delete multiple clusters at once, select them and click the Delete button near the top of the screen. When prompted to confirm, click Delete again.