[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-11-21。"],[],[],null,["# Deleting a cluster\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page explains how to delete a Google Kubernetes Engine (GKE) cluster.\n\nWhen you delete a cluster, GKE deletes the following resources:\n\n- The control plane resources\n- All of the node instances in the cluster\n- Any Pods that are running on those instances\n- Any firewalls and routes created by GKE at the time of cluster creation\n- Data stored in host `hostPath` and `emptyDir` volumes\n- If [registered to a fleet](/kubernetes-engine/fleet-management/docs/register/gke#register_your_cluster), the cluster's [fleet membership](/kubernetes-engine/fleet-management/docs/fleet-creation#about_fleet_membership), unless the cluster was registered using a legacy command.\n\nReview how GKE handles the following resources during cluster\ndeletion:\n\n- GKE attempts to delete all [load balancer](/compute/docs/load-balancing) 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.\n- GKE retains [persistent disk](/compute/docs/disks#pdspecs) volumes during cluster deletion. See how to [manage persistent storage during\n cluster\n deletion](/kubernetes-engine/docs/concepts/persistent-volumes#persistent-storage-cluster-deletion).\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\nDeleting a cluster\n------------------\n\n### gcloud\n\nTo delete a cluster using the Google Cloud CLI, run\nthe following command: \n\n gcloud container clusters delete \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the name of the cluster\nthat you want to delete.\n\nFor more information, refer to the\n[`gcloud container clusters delete`](/sdk/gcloud/reference/container/clusters/delete)\ndocumentation.\n\n### Console\n\nTo delete a cluster using the Google Cloud console, perform the following\nsteps:\n\n1. Go to the **Google Kubernetes Engine** page in the Google Cloud console.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. Next to the cluster you want to delete, click *more_vert* **Actions** , then click *delete* **Delete**.\n\n3. When prompted to confirm, click **Delete** again.\n\nTo delete multiple clusters at once, select them and click *delete*\n**Delete** . When prompted to confirm, click **Delete** again.\n\nWhat's next\n-----------\n\n- [Learn more about clusters](/kubernetes-engine/docs/concepts/cluster-architecture)."]]