Quickstart: Deploy an AKS cluster using Azure CLI (preview)

Applies to: AKS enabled by Azure Arc on VMware (preview)

This quickstart shows you how to deploy an AKS cluster in AKS enabled by Azure Arc on VMware using the Azure CLI.

Prerequisites

To complete this quickstart, you need to do these things:

Azure parameters

Parameter Parameter details
$aad_Group_Id The ID of a group whose members manage the target cluster. This group should also have owner permissions on the resource group containing the custom location and target cluster.
$appliance_Name Name of the Arc Resource Bridge created to connect vCenter with Azure.
$custom_Location Custom location name or ID. If you choose to Enable Kubernetes Service on VMware [preview] when you Connect vCenter to Azure from the Azure portal, a custom location with the prefix AKS-, and a default namespace, are created for you to deploy AKS on VMware. If you Enable Kubernetes Service on VMware [preview] using the Azure CLI process, you can specify the name of the custom location of your choice with the default namespace. You must use the default namespace.
$resource_Group Resource Group name or ID for deploying the Arc Resource Bridge.

vCenter server information

Parameter Parameter details
$network_name Name of the VMware network resource enabled in Azure.
$control_plane_ip The control plane IP for your target cluster. This control plane IP must be reserved/excluded in DHCP and different from the Arc Resource Bridge IP address

Step 1: Sign in to Azure

  1. Sign in to Azure using the following command:

    az login --use-device-code
    
  2. Set the Azure subscription ID to the subscription you used to deploy the Arc Resource Bridge and custom location:

    az account set -s $subscriptionID
    

Step 2: Create vNet for your AKS cluster using VMware network segment

  1. Define the network name as the name of the VMware network segment:

    $network_name = '<Name of the VMware Network segment>'
    
  2. Create a vNet with the same $resource_group you used to deploy your Arc Resource Bridge and $custom_location with the default namespace.

    az aksarc vnet create -n '<name of the vNet>' -g $resource_group --custom-location $custom_location --vsphere-segment-name $network_name
    
  3. Get the vNet ID:

    $vnet_id = az aksarc vnet show -n '<name of the vNET>'  -g $resource_group --query id -o tsv
    
  4. Pass the Control Plane IP endpoint for your target cluster:

    $control_plane_ip = '<Control Plane IP endpoint for your target cluster>'
    

    Note

    If the creation of the vNet times out, try running the commands again to recreate the vNet.

    Note

    The control plane IP must be reserved/excluded in DHCP and different from the Arc Resource Bridge IP address.

Step 3: Create the AKS cluster

Run the following command to create the cluster:

az aksarc create -n '<name of your cluster>' -g $resource_group --kubernetes-version 'v1.26.6' --custom-location $custom_location --aad-admin-group-object-ids $aad_group_id --vnet-ids $vnet_id --control-plane-ip $control_plane_ip --generate-ssh-keys --debug

Next steps