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.
A saída inclui o status do pool de nós, incluindo se é PROVISIONING ou RUNNING.
Criar um pool de nós em uma zona específica
Para criar um pool de nós em uma zona de disponibilidade específica do Azure, transmita a
sinalização --azure-availability-zone
à Google Cloud CLI na criação do pool.
Para criar um pool de nós em uma zona de disponibilidade específica do Azure com a
Google Cloud CLI, execute o seguinte comando:
[[["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-06-26 UTC."],[],[],null,["# Create a node pool\n==================\n\nThis page describes how to create a node pool.\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/azure/concepts/cluster-autoscaler).\n\nCustomize network security groups\n---------------------------------\n\nTo customize a network security group (NSG) for a node pool, see\n[Network security groups](/kubernetes-engine/multi-cloud/docs/azure/reference/security-groups).\n\nCreate a node pool\n------------------\n\nBefore you create a node pool, you need the following:\n\n- Permissions to use the `az` command-line tool to retrieve an Azure subnet ID.\n- Access to the cluster's SSH public key.\n\nTo create a node pool, run the following commands:\n\n1. Save your Azure VNet subnet ID and SSH public key to environment variables:\n\n SUBNET_ID=$(az network vnet subnet show \\\n --resource-group=\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e --vnet-name=\u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e \\\n --name default --query \"id\" -otsv)\n SSH_PUBLIC_KEY=$(cat \u003cvar translate=\"no\"\u003eKEY_PATH\u003c/var\u003e.pub)\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e: the resource group name that holds VNet\n - \u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e: the name of your VNet\n - \u003cvar translate=\"no\"\u003eKEY_PATH\u003c/var\u003e: the path to your key pair\n2. Create a node pool with the Google Cloud CLI:\n\n gcloud container azure node-pools create \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 1.32.4-gke.200 \\\n --vm-size \u003cvar translate=\"no\"\u003eVM_SIZE\u003c/var\u003e \\\n --max-pods-per-node 110 \\\n --min-nodes \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e \\\n --max-nodes \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e \\\n --ssh-public-key \"${SSH_PUBLIC_KEY}\" \\\n --subnet-id \"${SUBNET_ID}\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: a unique name for your node pool---for example, `node-pool-1`\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your GKE on Azure cluster\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the [Google Cloud location](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-regions) that manages your cluster\n - \u003cvar translate=\"no\"\u003eVM_SIZE\u003c/var\u003e: a [supported Azure VM size](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-vms)\n - \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e: the minimum number of nodes in the node pool---for more information, see [Cluster autoscaler](/kubernetes-engine/multi-cloud/docs/azure/concepts/cluster-autoscaler)\n - \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e: the maximum number of nodes in the node pool\n3. Check the status of your node pool:\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\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: a unique name for your node pool---for example, `node-pool-1`\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your GKE on Azure cluster\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the [Google Cloud location](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-regions) that manages your cluster\n\n The output includes the status of your node pool, including if it is\n `PROVISIONING` or `RUNNING`.\n\n### Create a node pool in a specific zone\n\nTo create a node pool in a specific Azure availability zone, pass the\n[`--azure-availability-zone`](/sdk/gcloud/reference/container/azure/node-pools/create#--azure-availability-zone)\nflag to the Google Cloud CLI when you create the node pool.\n\nTo create a node pool in a specific Azure availability zone with the\nGoogle Cloud CLI, run the following command: \n\n gcloud container azure node-pools create \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 1.32.4-gke.200 \\\n --vm-size \u003cvar translate=\"no\"\u003eVM_SIZE\u003c/var\u003e \\\n --max-pods-per-node 110 \\\n --min-nodes \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e \\\n --max-nodes \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e \\\n --azure-availability-zone \u003cvar translate=\"no\"\u003eAZURE_ZONE\u003c/var\u003e \\\n --ssh-public-key \"${SSH_PUBLIC_KEY}\" \\\n --subnet-id \"${SUBNET_ID}\"\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: a unique name for your node pool---for example, `node-pool-1`\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 location](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-regions) that manages your cluster\n- \u003cvar translate=\"no\"\u003eVM_SIZE\u003c/var\u003e: a [supported Azure VM size](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-vms)\n- \u003cvar translate=\"no\"\u003eMIN_NODES\u003c/var\u003e: the minimum number of nodes in the node pool---for more information, see [Cluster autoscaler](/kubernetes-engine/multi-cloud/docs/azure/concepts/cluster-autoscaler)\n- \u003cvar translate=\"no\"\u003eMAX_NODES\u003c/var\u003e: the maximum number of nodes in the node pool\n- \u003cvar translate=\"no\"\u003eAZURE_ZONE\u003c/var\u003e: the Azure availability zone where GKE on Azure launches the node pool--- for example, `3`\n\nWhat's next\n-----------\n\n- [View your cluster's status](/kubernetes-engine/multi-cloud/docs/azure/how-to/view-cluster-status).\n- Try the [Quickstart](/kubernetes-engine/multi-cloud/docs/azure/quickstart) to launch your first workload on GKE on Azure.\n- Learn about [Cluster autoscaler](/kubernetes-engine/multi-cloud/docs/azure/concepts/cluster-autoscaler)."]]