Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Knotenpool erstellen
Auf dieser Seite wird beschrieben, wie Sie einen Knotenpool erstellen.
Hinweis
Auf dieser Seite wird davon ausgegangen, dass Sie mit dem Cluster-Autoscaling vertraut sind. Weitere Informationen finden Sie unter Cluster Autoscaler.
Netzwerksicherheitsgruppen anpassen
Informationen zum Anpassen einer Netzwerksicherheitsgruppe (NSG) für einen Knotenpool finden Sie unter Netzwerksicherheitsgruppen.
Knotenpool erstellen
Bevor Sie einen Knotenpool erstellen können, benötigen Sie Folgendes:
Berechtigungen zum Verwenden des az-Befehlszeilentools zum Abrufen einer Azure-Subnetz-ID.
Zugriff auf den öffentlichen SSH-Schlüssel des Clusters.
Zum Erstellen eines Knotenpools führen Sie folgende Befehle aus:
Speichern Sie die Azure VNet-Subnetz-ID und den öffentlichen SSH-Schlüssel in Umgebungsvariablen:
Die Ausgabe enthält den Status Ihres Knotenpools, auch wenn er PROVISIONING oder RUNNING lautet.
Knotenpool in einer bestimmten Zone erstellen
Wenn Sie einen Knotenpool in einer bestimmten Azure-Verfügbarkeitszone erstellen möchten, übergeben Sie beim Erstellen des Knotenpools das Flag --azure-availability-zone an die Google Cloud CLI.
Führen Sie den folgenden Befehl aus, um einen Knotenpool in einer bestimmten Azure-Verfügbarkeitszone mit der Google Cloud CLI zu erstellen:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]