[[["易于理解","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):2025-09-04。"],[],[],null,["# Update a node pool\n==================\n\nThis topic explains how you can update your node pools. You can update your node\npools for the following reasons:\n\n- To upgrade your node pool version\n- To change the number of nodes in your node pool\n- To change your node pool annotations (Only updatable through API)\n\nYou can also change additional parameters on your node pools not listed above.\nFor a complete list of parameters you can update, see the\n[`gcloud container azure node-pools update`](/sdk/gcloud/reference/container/azure/node-pools/update)\nand the\n[`projects.locations.azureNodePools.patch`](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.azureClusters.azureNodePools/patch)\ndocumentation.\n\nUpdate process\n--------------\n\nThis section describes the processes GKE on Azure takes to update a\nnode pool. The process is different depending on the extent of changes\nnecessary to the node pool.\n\n### Configuration-only update\n\nIf GKE on Azure can update a node pool without restarting or\nrecreating any resources, it will make those changes. For example, updating\nyour node pool's annotations will not restart any instances.\n\n### Rolling update\n\nWhen a change to a node pool requires restarting existing virtual\nmachines--- for example, when updating the Kubernetes version---\nGKE on Azure performs the following steps:\n\n1. Modify the node pool's virtual machine scale set with new configuration.\n2. Choose one node's underlying instance to update.\n3. GKE on Azure cordons and [drains](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/) the node. At this point, new Pods can not be scheduled on the target node. Existing Pod objects on the target node are rescheduled onto other nodes. Pods that can't be rescheduled onto any other existing node stay in the [**Pending** phase](/kubernetes-engine/docs/concepts/pod#pod_lifecycle) until they can be scheduled.\n4. Update the instance to take the latest configuration from its virtual machine scale set.\n5. Reimage and reboot the instance.\n6. Wait until all the nodes in this node pool become healthy.\n7. If all nodes in this node pool are healthy, select another node until all nodes are updated. If any node is unhealthy, GKE on Azure places the node pool into a `DEGRADED` state. For more information, see [Failed updates](#failed).\n\n#### Protect workloads during a node pool rolling update\n\nDuring node pool rolling update, GKE on Azure honors PodDisruptionBudget \n\nconfiguration for up to one hour after a node starts to drain. After one hour, GKE on Azure\ndeletes any remaining Pods on the node.\nDuring rolling update, GKE on Azure performs a graceful shutdown of any nodes to be restarted or removed with the best effort for up to two hours. After two hours, if there are any remaining Pod objects on the node, GKE on Azure deletes the node and reimages the underlying virtual machine instance.\n\n### Resizing node pools\n\nGKE on Azure node pools have cluster autoscaler enabled by default. The\ncluster autoscaler automatically resizes the node pool based on the demands of\nyour workloads. For more information on the cluster autoscaler,\nsee [Cluster autoscaler](/kubernetes-engine/multi-cloud/docs/azure/concepts/cluster-autoscaler).\n\nWhen you change the maximum and minimum number of nodes in the node pool,\nGKE on Azure takes different actions depending on the new configuration\nand node pool's current number of nodes. These actions include the following:\n\n- If the node pool's current node count is already within the new range,\n GKE on Azure doesn't change the number of nodes in the pool.\n\n- If the new minimum number of nodes is higher than the node pool's current node\n count, GKE on Azure adds more nodes until the node pool reaches\n the new minimum size.\n\n\u003c!-- --\u003e\n\n- If the new maximum number of nodes is less than the node pool's current node\n count, GKE on Azure reduces the size of the node pool by\n performing the following actions:\n\n 1. Update the autoscaling configuration onto the virtual machine scale set in the node pool\n 2. Select a node to remove\n 3. Cordon and drain the node\n 4. Delete the underlying virtual machine instance\n 5. Wait until the deleted virtual machine is fully gone\n 6. Perform health check on the whole node pool\n 7. Repeat until the number of nodes reaches the desired number\n\n#### How GKE on Azure protects workloads during node pool resizing\n\nDuring node pool resizing, GKE on Azure honors PodDisruptionBudget\nconfiguration for up to one hour after a node starts to drain. After one hour,\nGKE on Azure deletes any remaining Pod objects on the node.\n\nDuring node pool resizing, GKE on Azure performs a graceful shutdown\nof any nodes to be restarted or removed and waits for up to two hours. After two\nhours, if there are any remaining Pod objects on the node,\nGKE on Azure deletes the underlying virtual machine instance.\n\n### Check for a failed update status\n\nIf GKE on Azure performs a health check after an update and the health\ncheck fails, the node pool is marked as `DEGRADED`. You can find\nstatus information on your cluster with the following Google Cloud CLI command: \n\n gcloud container azure node-pools describe \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\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of your node pool\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your cluster\n- \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the Google Cloud region that manages your cluster\n\nThe output includes information about the status and configuration of your\nnode pool.\n\nPrerequisites\n-------------\n\nTo update a node pool, you must have the\n`gkemulticloud.googleapis.com/azureNodePools.update` Identity and Access Management permission.\n\n\nUpdate a node pool\n------------------\n\nYou can update a node pool with the Google Cloud CLI. To update a node pool,\nrun: \n\n gcloud container azure node-pools update \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 --node-version \u003cvar translate=\"no\"\u003eNODE_POOL_VERSION\u003c/var\u003e \\\n --min-nodes \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e \\\n --max-nodes \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e \n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of the node pool to update\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the cluster to attach the node pool to\n- \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the [supported Google Cloud region](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-regions) that manages your cluster---for example, `us-west1`\n- \u003cvar translate=\"no\"\u003eNODE_POOL_VERSION\u003c/var\u003e: the new [supported node pool version](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-versions)\n- \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e: the new minimum number of nodes the node pool can contain. Must be `0` or greater.\n- \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e: the new maximum number of nodes the node pool can contain. Must at least `1` and the value of `MIN_NODES`.\n\nCancelling an update operation\n------------------------------\n\nTo cancel an ongoing node pool update operation, run the following command: \n\n gcloud container azure operations cancel \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e with the name of the update operation.\n\nNote that cancelling an update node pool operation which is in progress won't\nrevert node updates that have already completed. This can result in a partially\nupdated node pool.\n\nWhat's next\n-----------\n\n- Read the [gcloud container azure node-pools create](/sdk/gcloud/reference/container/azure/node-pools/create) reference documentation.\n- [Delete a node pool](/kubernetes-engine/multi-cloud/docs/azure/how-to/delete-node-pool)."]]