Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment supprimer des pools de nœuds dans GKE sur AWS.
Avant de commencer
Dans cette page, nous partons du principe que vous connaissez l'autoscaler de cluster. Pour en savoir plus, consultez la section Autoscaler de cluster.
Supprimer un pool de nœuds
Pour supprimer un pool de nœuds, exécutez la commande suivante :
Console
Dans la console Google Cloud , accédez à la page Vue d'ensemble des clusters Google Kubernetes Engine.
Sélectionnez le Google Cloud projet dans lequel se trouve le cluster.
Dans la liste des clusters, sélectionnez le nom du cluster, puis cliquez sur Afficher les détails dans le panneau latéral.
Sélectionnez l'onglet Nœuds pour afficher la liste de tous les pools de nœuds.
Sélectionnez un pool de nœuds dans la liste.
En haut de la fenêtre, cliquez sur delete
Supprimer.
Si la suppression échoue, suivez les étapes décrites dans l'onglet gcloud et ajoutez l'option --ignore-errors à la commande gcloud container aws node-pools delete.
Si la commande renvoie une erreur et que la suppression échoue, vous pouvez forcer la suppression en exécutant à nouveau la commande avec l'option --ignore-errors.
Cet indicateur est disponible à partir de la version 1.29.
Comment GKE sur AWS protège les charges de travail lors de la suppression des pools de nœuds
Pendant la suppression d'un pool de nœuds, GKE sur AWS effectue un arrêt progressif sur chaque nœud sans respecter PodDisruptionBudget. Il effectue les étapes suivantes :
Désactive l'autoscaler de cluster s'il était activé.
Définit un délai pour le processus de drainage. Après ce délai, même s'il reste des objets pod existants, GKE sur AWS arrête le drainage et continue à supprimer les machines virtuelles sous-jacentes. Le délai par défaut est de 5 minutes. Pour 10 nœuds de plus, 5 minutes supplémentaires sont ajoutées.
Confine tous les nœuds du pool de nœuds.
Avant l'expiration du délai, supprime les objets Pod du pool de nœuds dans la mesure du possible.
Supprime toutes les ressources de calcul sous-jacentes.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Delete a node pool\n\nThis page shows you how to delete node pools in GKE on AWS.\n\nBefore you begin\n----------------\n\nThis page assumes you are familiar with the cluster autoscaler. For more\ninformation, see [Cluster autoscaler](/kubernetes-engine/multi-cloud/docs/aws/concepts/cluster-autoscaler).\n\nDelete a node pool\n------------------\n\nTo delete a node pool, run the following command: \n\n### Console\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine clusters\n overview** page.\n\n [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)\n2. Select the Google Cloud project that the cluster is in.\n\n3. In the cluster list, select the name of the cluster, and then select\n **View details** in the side panel.\n\n4. Select the **Nodes** tab to see a list of all the node pools.\n\n5. Select a node pool from the list.\n\n6. Near the top of the window, click delete **Delete**.\n\n If the delete fails, follow the steps in the `gcloud` tab and add the\n `--ignore-errors` flag to the `gcloud container aws node-pools delete`\n command.\n\n### gcloud\n\n1. Get a list of your node pools:\n\n gcloud container aws node-pools list \\\n --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the cluster that the node pool is attached to\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the Google Cloud location hosting the node pool\n2. For each of your node pools, delete it with the following command:\n\n gcloud container aws node-pools delete \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e \\\n --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of the node pool to delete\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e\n\n If the command returns an error and the delete fails, you can force the\n deletion by running the command again with the `--ignore-errors` flag.\n This flag is available in version 1.29 and later.\n | **Caution:** Adding the `--ignore-errors` flag to the delete command might result in orphaned AWS resources. If that happens, consult the AWS documentation on how to remove the orphaned resources.\n\n#### How GKE on AWS protects workloads during node pool deletion\n\nDuring node pool deletion, GKE on AWS performs graceful shut down on\neach node without honoring PodDisruptionBudget. It takes the following\nsteps:\n\n1. Disable cluster autoscaler if it was enabled.\n2. Set up a deadline for the draining process. After this deadline, even if there are still Pod objects existing, GKE on AWS stops draining and proceeds to deleting underlying virtual machines. The default deadline is 5 minutes. For every 10 more nodes, 5 more minutes is added.\n3. Cordon all the nodes in the node pool.\n4. Before deadline is met, delete Pod objects in the node pool with best efforts.\n5. Delete all the underlying compute resources.\n\nWhat's next\n-----------\n\n- Read the reference guide for [gcloud container aws node-pools](https://cloud.google.com/sdk/gcloud/reference/container/aws/node-pools)."]]