Cette documentation concerne la version la plus récente de GKE sur Azure, publiée en novembre 2021. Consultez les notes de version pour plus d'informations.
Le résultat inclut l'état de votre pool de nœuds, y compris s'il s'agit de PROVISIONING ou de RUNNING.
Créer un pool de nœuds dans une zone spécifique
Pour créer un pool de nœuds dans une zone de disponibilité Azure spécifique, transmettez l'option --azure-availability-zone à la CLI Google Cloud lors de la création du pool de nœuds.
Pour créer un pool de nœuds dans une zone de disponibilité Azure spécifique à l'aide de la CLI Google Cloud, exécutez la commande suivante :
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/07/31 (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/07/31 (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)."]]