Revise como o GKE lida com os seguintes recursos durante a exclusão
do cluster:
O GKE tenta excluir todos os recursos do balanceador de carga. No entanto, para os Serviços (type: LoadBalancer), recomendamos que você exclua os Serviços antes de excluir o cluster. Para clusters com centenas de serviços ou mais, o GKE pode não excluir todos os recursos do balanceador de carga após a exclusão do cluster.
Se você quiser usar a Google Cloud CLI para essa tarefa,
instale e, em seguida,
inicialize a
CLI gcloud. Se você instalou a CLI gcloud anteriormente, instale a versão
mais recente executando gcloud components update.
Como excluir um cluster
gcloud
Para excluir um cluster usando a Google Cloud CLI, execute
este comando:
gcloudcontainerclustersdeleteCLUSTER_NAME
Substitua CLUSTER_NAME com o nome do cluster
que você quer excluir.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-11-22 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)."]]