Tinjau cara GKE menangani resource berikut selama penghapusan cluster:
GKE mencoba menghapus semua resource load balancer. Namun, untuk Layanan (type: LoadBalancer), sebaiknya
Anda menghapus Layanan sebelum menghapus cluster. Untuk cluster dengan ratusan Layanan atau lebih, GKE mungkin tidak menghapus semua resource load balancer saat penghapusan cluster.
Jika ingin menggunakan Google Cloud CLI untuk tugas ini,
instal lalu
lakukan inisialisasi
gcloud CLI. Jika sebelumnya Anda telah menginstal gcloud CLI, dapatkan versi terbaru dengan menjalankan gcloud components update.
Menghapus cluster
gcloud
Untuk menghapus cluster menggunakan Google Cloud CLI, jalankan
perintah berikut:
gcloudcontainerclustersdeleteCLUSTER_NAME
Ganti CLUSTER_NAME dengan nama cluster
yang ingin Anda hapus.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-31 UTC."],[],[],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)."]]