共用方式為


啟用 AKS Arc 運算符的 Kubernetes 擴充功能 (預覽)

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

若要在 VMware 預覽上使用 AKS Arc,您必須先透過 Arc 資源網橋將 vCenter 連線至 Azure,讓已啟用 Arc 的 VMware vSphere 上線,有兩種案例可供存取此預覽:

開始之前

開始之前, 請先安裝 Azure CLI

步驟 1: 第一次註冊使用者的功能/提供者

如果您的訂用帳戶第一次部署適用於 AKS Arc 運算子的 Kubernetes 擴充功能 (預覽) ,您必須註冊預覽功能。

  1. 準備您的 Azure 帳戶:

     az login --use-device-code
     az account set -s '<$subscriptionID>'
    
  2. 執行一次性功能註冊:

    ### Register your subscription ID with the feature
    az feature register --namespace Microsoft.HybridConnectivity --name hiddenPreviewAccess
    
    ### Check feature registrationState -o tsv == Registered
    az feature show --name hiddenPreviewAccess --namespace Microsoft.HybridConnectivity
    
  3. 執行一次性提供者註冊:

    ### Register your subscription ID with the provider
    az provider register --namespace "Microsoft.HybridContainerService" 
    az provider register --namespace "Microsoft.HybridConnectivity"
    
    ### Check provider registrationState -o tsv == Registered
    az provider show -n Microsoft.HybridContainerService --query registrationState
    az provider show -n Microsoft.HybridConnectivity --query registrationState
    

步驟 2: 安裝 aksarc CLI 擴充功能

安裝 CLI 擴充功能。 使用 az extension add 命令:

az extension add -n aksarc --version 1.0.0b1
az extension add -n connectedk8s
az extension add -n k8s-extension
az extension add -n arcappliance
az extension add -n customlocation

步驟 3: 安裝 AKS Arc 運算子的 Kubernetes 擴充功能

  1. 指定 AKS Arc 運算子的 Kubernetes 延伸模組版本:

    $extension_name = 'hybridaksopext'
    $extension_version = '0.4.5'
    $extension_release_train = 'preview'
    
    export extension_name='hybridaksopext'
    export extension_version='0.4.5'
    export extension_release_train='preview'
    
  2. $resource_group指定 與 $appliance_name

    $resource_group = '$resourceGroup from Arc Resource Bridge deployment'
    $appliance_name = '$applianceName from Arc Resource Bridge deployment'
    
  3. 安裝 AKS Arc 運算子的 Kubernetes 擴充功能:

    az k8s-extension create -g $resource_group -c $appliance_name --cluster-type appliances --name $extension_name --extension-type Microsoft.HybridAKSOperator --version $extension_version --release-train $extension_release_train --config Microsoft.CustomLocation.ServiceAccount="default" --auto-upgrade false 
    

步驟 4: 準備您的自定義位置

自定義位置是在 Arc 資源網橋部署期間建立的。

  1. 取得識別碼以設定自訂位置:

    ### $extension_name = 'hybridaksopext'
    $ArcApplianceResourceId = (az arcappliance show -g $resource_group -n $appliance_name --query id -o tsv)
    $ClusteraksExtensionId = (az k8s-extension show -g $resource_group -c $appliance_name --cluster-type appliances --name $extension_name --query id -o tsv)
    
  2. 指定您在 Arc 資源網橋部署期間建立的 $customLocationResourceGroupName$customLocationName

    $customLocationResourceGroupName = '$resourceGroup from Arc Resource Bridge deployment'
    $customLocationName = '$customLocationName from Arc Resource Bridge deployment'
    
  3. 修補自定義位置: ProvisioningState: "Patching"

    ### Use the same custom location information from the Arc Resource Bridge deployment
    az customlocation patch -g $customLocationResourceGroupName -n $customLocationName --cluster-extension-ids $clusteraksExtensionId
    
  4. 確認自訂位置布建狀態成功: : ProvisioningState: "Succeeded"

    az customlocation show -g $customLocationResourceGroupName -n $customLocationName 
    

既然您已成功啟用 AKS Arc 運算子的 Kubernetes 延伸模組 (預覽) ,您可以繼續進行後續步驟來建立 Kubernetes 叢集。

從 VMware 上的 AKS Arc 部署清除環境

完成 VMware 預覽版 AKS Arc 評估之後,您可以遵循下列步驟來清除您的環境:

  1. 刪除 AKS 叢集。 若要刪除工作負載叢集,請使用 az aksarc delete 命令,或移至 Azure 入口網站:

    az aksarc delete -n '<cluster name>' -g $applianceResourceGroupName
    
  2. 卸載 Kubernetes 擴充功能。 您可以使用 az extension remove 命令卸載適用於 AKS Arc 運算符的 Kubernetes 延伸模組:

    az extension remove -n aksarc
    az extension remove -n connectedk8s
    

下一步

  • 如果您開始評估 VMware 上的 AKS Arc 預覽版並完成啟用 AKS Arc 運算符的 Kubernetes 擴充功能,您可以遵循快速入門中的指示來建立 Kubernetes 叢集:使用 Azure CLI 部署 AKS 叢集
  • 如果您已完成 VMware 上的 AKS Arc 評估,您可以透過 GitHub 與我們分享您的意見反應。