Deleting a cluster


This page explains how to delete a Google Kubernetes Engine (GKE) cluster.

When you delete a cluster, GKE deletes the following resources:

  • The control plane 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 hostPath and emptyDir volumes
  • If registered to a fleet, the cluster's fleet membership, unless the cluster was registered using a legacy command.

Review how GKE handles the following resources during cluster deletion:

  • GKE attempts to delete all load balancer resources. However, for Services (type: LoadBalancer), we recommend that you delete the Services before deleting your cluster. For clusters with hundreds of Services or more, GKE might not delete all load balancer resources upon cluster deletion.
  • GKE retains persistent disk volumes during cluster deletion. See how to manage persistent storage during cluster deletion.

Before you begin

Before you start, make sure you have performed the following tasks:

  • Enable the Google Kubernetes Engine API.
  • Enable Google Kubernetes Engine API
  • If you want to use the Google Cloud CLI for this task, install and then initialize the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running gcloud components update.

Deleting a cluster

gcloud

To delete a cluster using the Google Cloud CLI, run the following command:

gcloud container clusters delete CLUSTER_NAME

Replace CLUSTER_NAME with the name of the cluster that you want to delete.

For more information, refer to the gcloud container clusters delete documentation.

Console

To delete a cluster using the Google Cloud console, perform the following steps:

  1. Go to the Google Kubernetes Engine page in the Google Cloud console.

    Go to Google Kubernetes Engine

  2. Next to the cluster you want to delete, click Actions, then click Delete.

  3. When prompted to confirm, click Delete again.

To delete multiple clusters at once, select them and click Delete. When prompted to confirm, click Delete again.

What's next