Esta documentação é referente à versão mais recente do GKE no Azure, lançada em novembro de 2021. Consulte as Notas de lançamento para mais informações.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Fazer upgrade da versão do cluster do Azure
Nesta página, explicamos como fazer upgrade da versão do Kubernetes do
GKE em clusters do Azure.
Pré-requisitos
O upgrade da versão do Kubernetes do cluster é um caso específico da operação de atualização de cluster mais geral. Leia sobre operações de atualização de cluster
em geral na página Atualizar o cluster. Para fazer upgrade da versão do cluster, faça o seguinte:
É necessário fazer upgrade por meio de cada versão secundária entre a versão atual e a de destino. Por exemplo, para fazer o upgrade de 1.20 para 1.22, primeiro faça upgrade
da 1.20 para 1.21, depois faça upgrade da 1.21 para 1.22.
É necessário ter a permissão gkemulticloud.googleapis.com/azureClusters.update do Identity and Access Management.
Como o GKE no Azure faz atualizações
Como o upgrade de um cluster requer a reinicialização dos nós do plano de controle,
o GKE no Azure executa uma "atualização gradual" com as seguintes etapas:
Escolha uma instância do plano de controle para atualizar. O GKE no Azure atualiza
instâncias não íntegras, se houver, antes das íntegras.
Exclua a instância. O GKE no Azure recria a instância e ela é inicializada com a nova configuração.
Faça verificações de integridade na nova instância.
Se as verificações de integridade forem bem-sucedidas, selecione outra instância e execute as
mesmas etapas nela. Repita esse ciclo até que todas as instâncias sejam reiniciadas ou recriadas.
Se a verificação de integridade falhar, o GKE no Azure
colocará o cluster em um estado DEGRADED e interromperá a atualização. Para mais informações, consulte a seção a seguir.
Quando uma atualização falha
Após uma atualização, o GKE no Azure executa uma verificação de integridade no cluster.
Se a verificação de integridade falhar, o cluster será marcado como DEGRADED. É possível exibir
o status do cluster com o seguinte comando da Google Cloud CLI:
Substitua GOOGLE_CLOUD_LOCATION pelo local Google Cloud
em que você gerencia os clusters.
Escolher um método de upgrade
É possível fazer upgrade da versão do cluster usando o console Google Cloud , a
Google Cloud CLI ou a API GKE Multi-Cloud. Se você quiser usar o console para fazer upgrade de
um cluster, primeiro escolha e configure um método de autenticação para
fazer login no cluster. Saiba mais em Conectar e autenticar no cluster.
Console
No Google Cloud console, acesse a página Visão geral dos clusters do Google Kubernetes Engine.
Selecione o Google Cloud projeto em que o cluster está.
Na lista de clusters, selecione o nome do cluster e, em seguida,
Ver detalhes no painel lateral.
Na guia Detalhes, selecione edit
Fazer upgrade.
Na caixa de diálogo Fazer upgrade da versão do Kubernetes do cluster,
selecione a versão para que você quer fazer upgrade e clique em Concluído. Lembre-se de
fazer upgrade em todas as versões secundárias nos upgrades do seu cluster.
gcloud
Para fazer upgrade da versão do Kubernetes do cluster, execute o seguinte comando:
CLUSTER_VERSION: a nova
versão de cluster compatível; Observe que você precisa fazer upgrade em todas as versões secundárias ao fazer upgrade do cluster
Atualize essas configurações por meio da API GKE Multi-Cloud com o comando a seguir.
Depois de fazer upgrade da versão do cluster, faça upgrade dos pools de nós para concluir o
processo. Para saber como, consulte
Atualizar um pool de nós.
[[["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 2025-07-14 UTC."],[],[],null,["# Upgrade your Azure cluster version\n==================================\n\nThis page explains how to upgrade the Kubernetes version of your\nGKE on Azure clusters.\n\nPrerequisites\n-------------\n\nUpgrading your cluster's Kubernetes version is a specific case of the more\ngeneral cluster update operation. You can read about cluster update operations\nin general at the [update your cluster](/kubernetes-engine/multi-cloud/docs/azure/how-to/update-cluster)\npage. To upgrade your cluster version:\n\n- You must upgrade through every minor version between the current and target version. For example, to upgrade from 1.20 to 1.22, you must first upgrade from 1.20 to 1.21, and then upgrade from 1.21 to 1.22.\n- You must have the `gkemulticloud.googleapis.com/azureClusters.update` Identity and Access Management permission.\n\nHow GKE on Azure performs updates\n---------------------------------\n\nBecause upgrading a cluster requires restarting the control plane nodes,\nGKE on Azure performs a \"rolling update\" with the following steps:\n\n1. Choose one control plane instance to update. GKE on Azure updates unhealthy instances, if any, before healthy ones.\n2. Delete the instance. GKE on Azure recreates the instance and the instance boots with the new configuration.\n3. Perform health checks on the new instance.\n4. If the health checks succeed, select another instance and perform the same steps on it. Repeat this cycle until all instances are restarted or recreated. If the health check fails, GKE on Azure places the cluster into a `DEGRADED` state and stops the update. For more information, see the following section.\n\nWhen an update fails\n--------------------\n\nAfter an update, GKE on Azure performs a health check on the cluster.\nIf the health check fails, the cluster is marked as `DEGRADED`. You can display\nthe status of your cluster with the following Google Cloud CLI command: \n\n gcloud container azure clusters describe \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\"\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\nPerform the upgrade\n-------------------\n\n### Check your cluster version\n\nBefore upgrading your cluster version, use the following command to check which\nversions are available in your region: \n\n gcloud container azure get-server-config \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e with the Google Cloud\nlocation from which you manage your clusters.\n\n### Choose an upgrade method\n\nYou can upgrade your cluster version through either the Google Cloud console, the\nGoogle Cloud CLI or the GKE Multi-Cloud API. If you want to use the console to upgrade\na cluster, you must first choose and configure an authentication method for\nlogging in to the cluster. For more information, see\n[Connect and authenticate to your cluster](/kubernetes-engine/multi-cloud/docs/azure/how-to/connect-and-authenticate-to-your-cluster). \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. On the **Details** tab, select edit **Upgrade**.\n\n5. In the **Upgrade the Kubernetes version for the cluster** dialog box,\n select the version that you want to upgrade to and click **Done**. Note that\n you must upgrade through all minor versions when upgrading your cluster.\n\n### gcloud\n\nTo upgrade your cluster's Kubernetes version, run the following command: \n\n gcloud container azure clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e \\\n --cluster-version=\u003cvar translate=\"no\"\u003eCLUSTER_VERSION\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: your cluster's name\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\"\u003eCLUSTER_VERSION\u003c/var\u003e: the new [supported cluster version](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-versions)\n\n### API\n\nTo update your cluster through the API, use a `PATCH` operation on the\nGKE Multi-Cloud API.\n\n1. Create a JSON file named `cluster_update.json` with the following\n contents:\n\n ```json\n {\n \"controlPlane\": {\n \"version\": \"CLUSTER_VERSION\",\n },\n }\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_VERSION\u003c/var\u003e: the new [supported cluster version](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-versions). Note that you must upgrade through all minor versions when upgrading your cluster\n2. Update these settings through the GKE Multi-Cloud API with following command.\n\n curl -d @cluster_update.json -X PATCH \\\n \u003cvar translate=\"no\"\u003eENDPOINT\u003c/var\u003e/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e/azureClusters/\u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e?update_mask=controlPlane.Version\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eENDPOINT\u003c/var\u003e: Your Google Cloud [service endpoint](/kubernetes-engine/multi-cloud/docs/reference/rest#rest_endpoints)\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud project\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\"\u003eCLUSTER_ID\u003c/var\u003e: Your cluster ID\n\nFor more information, see the\n[`projects.locations.azureClusters.patch`](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.azureClusters/patch)\nmethod documentation.\n\nUpgrade your node pools\n-----------------------\n\nAfter you upgrade your cluster version, upgrade your node pools to complete the\nprocess. To learn how, see\n[Update a node pool](/kubernetes-engine/multi-cloud/docs/azure/how-to/update-node-pool).\n\nWhat's next\n-----------\n\n- Learn how to perform other [cluster updates](/kubernetes-engine/multi-cloud/docs/azure/how-to/update-cluster).\n\n- For more information on updatable fields, see the\n [`gcloud container azure clusters update`](/sdk/gcloud/reference/container/azure/clusters/update)\n reference documentation.\n\n- See the\n [`projects.locations.azureClusters.patch`](/kubernetes-engine/multi-cloud/docs/reference/rest/v1/projects.locations.azureClusters/patch)\n REST API documentation."]]