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.
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Créer un réseau virtuel Azure
Avant de pouvoir déployer un cluster Anthos sur Azure, vous devez créer un réseau virtuel Azure (VNet) dans lequel votre cluster s'exécutera. Cette page explique comment procéder.
Toutefois, avant de créer un VNet Azure, nous vous recommandons de créer un groupe de ressources distinct pour le VNet, qui sera différent du groupe de ressources que vous créerez ultérieurement pour votre GKE sur Azure. Cette séparation peut vous aider à mieux organiser et gérer vos ressources.
Pour créer un groupe de ressources pour votre réseau VNet Azure, exécutez la commande suivante :
az group create --name "VNET_RESOURCE_GROUP_NAME" \
--location "AZURE_REGION"
Remplacez les éléments suivants :
VNET_RESOURCE_GROUP_NAME : nom du groupe de ressources de votre cluster GKE sur Azure VNet
Maintenant que vous avez créé un groupe de ressources pour votre Vnet Azure, suivez les étapes suivantes pour créer un VNet avec un sous-réseau par défaut, puis associez une passerelle NAT à ce sous-réseau :
Pour créer un réseau VNet avec un sous-réseau par défaut, exécutez la commande suivante :
VNET_RESOURCE_GROUP_NAME: nom du groupe de ressources pour le VNet que vous avez créé au début de ce document
VNET_ADDRESS_PREFIXES : liste de préfixes d'adresses IP, séparés par des espaces, au format CIDR. Par exemple, 10.0.0.0/16 172.16.0.0/12.
Pour créer une adresse IP pour une nouvelle passerelle NAT, associer une passerelle NAT à l'adresse IP et associer la passerelle NAT au sous-réseau par défaut, exécutez les commandes suivantes :
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 2024/07/01 (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 2024/07/01 (UTC)."],[],[],null,["# Create an Azure virtual network\n===============================\n\nBefore you can deploy an Anthos cluster on Azure, you need to create an Azure\nvirtual network (VNet) in which your cluster will run. This page explains how to\ndo that.\n\nHowever, before creating an Azure VNet, we recommend that you create a new\nresource group for the VNet that is separate from the resource group you will\ncreate later for your GKE on Azure. This separation can help better\norganize and manage your resources.\n\nTo create a new resource group for your Azure VNet, run the following command: \n\n az group create --name \"\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e\" \\\n --location \"\u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e\"\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e: the name of the resource group for your GKE on Azure VNet\n- \u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e: a [supported Azure region](/kubernetes-engine/multi-cloud/docs/azure/reference/supported-regions)---for example `westus2`\n\nNow that you have created a resource group for your Azure Vnet, perform the\nfollowing steps to create a VNet with a default subnet, and attach a NAT gateway\nto that subnet:\n\n1. To create a new VNet with a default subnet, run the following command:\n\n az network vnet create \\\n --name \"\u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e\" \\\n --location \"\u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e\" \\\n --resource-group \"\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e\" \\\n --address-prefixes \u003cvar translate=\"no\"\u003eVNET_ADDRESS_PREFIXES\u003c/var\u003e \\\n --subnet-name default\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e: the name of your VNet\n - \u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e: the Azure region used previously\n - \u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e: the name of the resource group for your VNet that you created at the beginning of this document\n - \u003cvar translate=\"no\"\u003eVNET_ADDRESS_PREFIXES\u003c/var\u003e: a space-separated list of IP address prefixes in CIDR notation---for example `10.0.0.0/16 172.16.0.0/12`\n2. To create an IP address for a new NAT gateway, attach a NAT gateway to the\n IP address, and attach the NAT gateway to the default subnet, run the\n following commands:\n\n az network public-ip create \\\n --name \"\u003cvar translate=\"no\"\u003eNAT_GATEWAY_NAME\u003c/var\u003e-ip\" \\\n --location \"\u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e\" \\\n --resource-group \"\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e\" \\\n --allocation-method Static \\\n --sku Standard\n\n az network nat gateway create \\\n --name \"\u003cvar translate=\"no\"\u003eNAT_GATEWAY_NAME\u003c/var\u003e\" \\\n --location \"\u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e\" \\\n --resource-group \"\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e\" \\\n --public-ip-addresses \"\u003cvar translate=\"no\"\u003eNAT_GATEWAY_NAME\u003c/var\u003e-ip\" \\\n --idle-timeout 10\n\n az network vnet subnet update \\\n --name default \\\n --vnet-name \"\u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e\" \\\n --resource-group \"\u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e\" \\\n --nat-gateway \"\u003cvar translate=\"no\"\u003eNAT_GATEWAY_NAME\u003c/var\u003e\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNAT_GATEWAY_NAME\u003c/var\u003e: the name of the new NAT gateway\n - \u003cvar translate=\"no\"\u003eVNET_NAME\u003c/var\u003e: the name of your VNet\n - \u003cvar translate=\"no\"\u003eAZURE_REGION\u003c/var\u003e: the Azure region used previously\n - \u003cvar translate=\"no\"\u003eVNET_RESOURCE_GROUP_NAME\u003c/var\u003e: the name of the resource group for your VNet that you created at the beginning of this document\n\nWhat's next\n-----------\n\n- [Create an Azure resource group](/kubernetes-engine/multi-cloud/docs/azure/how-to/create-azure-resource-group)"]]