Questa pagina fornisce istruzioni per configurare i nodi Windows Server
nel cluster Google Kubernetes Engine (GKE) in modo che si uniscano automaticamente a un dominio Active
Directory (AD).
Se vuoi utilizzare Google Cloud CLI per questa attività,
installala e poi
inizializza
gcloud CLI. Se hai già installato gcloud CLI, scarica l'ultima
versione eseguendo gcloud components update.
NUMBER_OF_NODES: il numero di nodi Linux da creare. Devi fornire risorse di calcolo sufficienti per eseguire i componenti aggiuntivi del cluster. Questo è un campo facoltativo e, se omesso, utilizza il valore predefinito
3.
VERSION: la versione del cluster GKE,
che deve essere 1.17.14-gke.1200 o versioni successive oppure
1.18.9-gke.100 o versioni successive. Puoi anche utilizzare il flag --release-channel
per registrare il cluster in un canale di rilascio.
--enable-ip-alias attiva l'IP alias. L'IP alias è
obbligatorio per i nodi Windows Server.
MACHINE_TYPE_NAME: il tipo di macchina. n1-standard-2
è il tipo di macchina minimo consigliato, poiché i nodi Windows Server richiedono
risorse aggiuntive. I tipi di macchine f1-micro e g1-small non sono supportati. Ogni tipo di macchina viene fatturato in modo diverso. Per ulteriori
informazioni, consulta il listino prezzi dei tipi di macchine.
Il nodo Windows Server è ora unito al tuo dominio Active Directory.
Passaggi successivi
Per utilizzare un account di servizio gestito dal gruppo (gMSA) con i pool di nodi Windows Server, consulta la sezione Utilizzo di gMSA.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],null,["# Configure Windows Server nodes to automatically join an Active Directory domain\n\n[Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page provides instructions to configure your [Windows Server nodes](/kubernetes-engine/docs/how-to/creating-a-cluster-windows)\nin your Google Kubernetes Engine (GKE) cluster to automatically join an Active\nDirectory (AD) domain.\n\nIf you want to join your Windows Server nodes to a\n[Managed Microsoft AD](/managed-microsoft-ad/docs/overview) domain and\ndon't require a security group that contains the computer objects of your\ncluster, you can use the automated domain join feature. For more information,\nsee [Join GKE Windows Server nodes automatically to a\nManaged Microsoft AD\ndomain](/managed-microsoft-ad/docs/automated-domain-join-gke).\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\n\u003c!-- --\u003e\n\n- Ensure you have the correct IAM permission to create clusters. At minimum, you should be a [Kubernetes Engine Cluster Admin](/iam/docs/understanding-roles#kubernetes-engine-roles).\n\nConfigure auto join for Windows Server node pools\n-------------------------------------------------\n\n1. Configure AD and your Google Cloud project for automatic\n joining by completing the instructions in the\n [Configuring Active Directory for VMs to automatically join a domain](/solutions/configuring-active-directory-for-vms-to-automatically-join-the-domain)\n tutorial.\n\n2. Create a GKE cluster:\n\n gcloud container clusters create \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --enable-ip-alias \\\n --num-nodes=\u003cvar translate=\"no\"\u003eNUMBER_OF_NODES\u003c/var\u003e \\\n --no-enable-shielded-nodes \\\n --cluster-version=\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your new cluster.\n - \u003cvar translate=\"no\"\u003eNUMBER_OF_NODES\u003c/var\u003e: the number of Linux nodes to create. You should provide sufficient compute resources to run cluster add-ons. This is an optional field and, if omitted, uses the default value of 3.\n - \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e: the GKE cluster version, which must be 1.17.14-gke.1200 or later or 1.18.9-gke.100 or later. You can also use the [`--release-channel`](/sdk/gcloud/reference/container/clusters/create#--release-channel) flag to enroll the cluster in a release channel.\n - `--enable-ip-alias` turns on [alias IP](/vpc/docs/alias-ip). Alias IP is required for Windows Server nodes.\n - `--no-enable-shielded-nodes` disables Shielded GKE Nodes.\n3. Set the following variables:\n\n export DOMAIN_PROJECT_ID=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n export SERVERLESS_REGION=\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e\n export REGISTER_URL=https://$SERVERLESS_REGION-$DOMAIN_PROJECT_ID.cloudfunctions.net/register-computer\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the [project ID](https://cloud.google.com/resource-manager/docs/creating-managing-projects) of your domain project.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region to [deploy your Cloud Run function](/solutions/configuring-active-directory-for-vms-to-automatically-join-the-domain) in. Choose a region that supports both [Cloud Run functions](/functions/docs/locations) and [Serverless VPC Access](/vpc/docs/configure-serverless-vpc-access#supported_regions). The region does not have to be the same region as the one you plan to deploy VM instances in.\n4. Create and start a Windows Server node pool by passing the specialized\n scriptlet that joins the node to the AD domain:\n\n gcloud container node-pools create \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e \\\n --cluster=\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --image-type=\u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e \\\n --no-enable-autoupgrade \\\n --machine-type=\u003cvar translate=\"no\"\u003eMACHINE_TYPE_NAME\u003c/var\u003e \\\n \"--metadata=sysprep-specialize-script-ps1=iex((New-Object System.Net.WebClient).DownloadString('$REGISTER_URL'))\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of your Windows Server node pool.\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the cluster you created.\n - \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e: the node image to use, such as `WINDOWS_LTSC_CONTAINERD`. For more information, see [Choose your Windows Server node image](/kubernetes-engine/docs/how-to/creating-a-cluster-windows#choose_your_windows_server_node_image).\n - \u003cvar translate=\"no\"\u003eMACHINE_TYPE_NAME\u003c/var\u003e: the machine type. `n1-standard-2` is the minimum recommended machine type as Windows Server nodes require additional resources. Machine types `f1-micro` and `g1-small` are not supported. Each machine type is billed differently. For more information, refer to the [machine type price sheet](/compute/pricing#standard_machine_types).\n\nYour Windows Server node is now joined to your Active Directory domain.\n\nWhat's next\n-----------\n\n- To use a Group Managed Service Account (gMSA) with your Windows Server node pools, see [Using gMSA](/kubernetes-engine/docs/how-to/creating-a-cluster-windows#using_gmsa).\n- Learn about the [Managed Service for Microsoft Active Directory](/managed-microsoft-ad/docs/overview)."]]