快速入門:使用 Azure CLI 部署 AKS 叢集 (預覽)

適用於:Azure Arc 在 VMware 上啟用的 AKS (預覽版)

本快速入門說明如何使用 Azure CLI 在 VMware 上由 Azure Arc 啟用的 AKS 中部署 AKS 叢集。

必要條件

若要完成本快速入門,您需要執行下列動作:

Azure 參數

參數 參數詳細數據
$aad_Group_Id 其成員管理目標叢集的群組標識符。 此群組也應該具有包含自定義位置和目標叢集的資源群組擁有者許可權。
$appliance_Name 建立以連線 vCenter 與 Azure 的 Arc 資源網橋名稱。
$custom_Location 用於部署 Arc 資源網橋的自定義位置名稱或識別碼。 相同的名稱適用於 AKS 延伸模組。
$resource_Group 用於部署 Arc 資源網橋的資源組名或標識碼。

vCenter 伺服器資訊

參數 參數詳細數據
$network_name 在 Azure 中啟用 VMware 網路資源的名稱。
$control_plane_ip 目標叢集的控制平面IP。 此控制平面 IP 必須在 DHCP 中保留/排除,且與 Arc Resource Bridge IP 位址不同

步驟 1:登入 Azure

  1. 使用下列命令登入 Azure:

    az login --use-device-code
    
  2. 將 Azure 訂用帳戶識別碼設定為您用來部署 Arc 資源網橋和自定義位置的訂用帳戶:

    az account set -s $subscriptionID
    

步驟 2:使用 VMware 網路區段為您的 AKS 叢集建立 vNet

  1. 將網路名稱定義為 VMware 網路區段的名稱:

    $network_name = '<Name of the VMware Network segment>'
    
  2. 建立具有相同且$resource_group$custom_location您用來部署 Arc 資源網橋的 vNet:

    az aksarc vnet create -n '<name of the vNet>' -g $resource_group --custom-location $custom_location --vsphere-segment-name $network_name
    
  3. 取得 vNet 識別碼:

    $vnet_id = az aksarc vnet show -n '<name of the vNET>'  -g $resource_group --query id -o tsv
    
  4. 傳遞目標叢集的控制平面 IP 端點:

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

    注意

    如果 vNet 的建立逾時,請嘗試再次執行命令以重新建立 vNet。

    注意

    控制平面 IP 必須在 DHCP 中保留/排除,且與 Arc Resource Bridge IP 位址不同。

步驟 3:建立 AKS 叢集

執行下列命令以建立叢集:

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

下一步