共用方式為


管理 AKS 叢集的節點集區

適用於:Azure Stack HCI 版本 23H2

注意

如需在 Azure Stack HCI 22H2 上的 AKS 中管理節點集區的相關信息,請參閱 管理節點集區

在 Azure Arc 所啟用的 AKS 中,相同組態的節點會群組在一起成 節點集區。 這些節點集區包含用來執行應用程式的基礎 VM。 本文說明如何建立和管理 AKS 叢集的節點集區。

建立 Kubernetes 叢集

若要開始使用,請使用單一節點集區建立 Kubernetes 叢集:

az aksarc create -n <cluster name> -g <resource group> --custom-location <custom location Id> --vnet-ids <vnet id> --generate-ssh-keys --load-balancer-count <load balancer count>

新增節點集區

您可以使用 命令,將節點集區新增至現有的叢集 az aksarc nodepool add 。 請確定節點集區的名稱與現有的節點集區名稱不同:

az aksarc nodepool add --name <node pool name> -g <resource group> --cluster-name <cluster name> --os-sku <Linux or Windows> --node-count <count> --node-vm-size <vm size>

取得節點集區的組態資訊

若要查看節點集區的組態,請使用 az aksarc nodepool show 命令:

az aksarc nodepool show --cluster-name <cluster name> -n <node pool name> -g <resource group>

範例輸出:

{
"availabilityZones": null,
"count": 1,
"extendedLocation": null,
"id":
"/subscriptions/&lt;subscription&gt;/resourceGroups/edgeci-registration-rr1s46r1710&lt;resource
group&gt;/providers/Microsoft.Kubernetes/connectedClusters/&lt;cluster
name&gt;/providers/Microsoft.HybridContainerService/provisionedClusterInstances/default/agentPools/&lt;nodepoolname&gt;",
"location": "westeurope",
"name": "nodepoolname",
"nodeImageVersion": null,
"osSku": "CBLMariner",
"osType": "Linux",
"provisioningState": "Succeeded",
"resourceGroup": "resourcegroup",
"status": {
  "errorMessage": null,
  "operationStatus": null,
  "readyReplicas": [
   {
    "count": 1,
    "vmSize": "Standard\_A4\_v2"
   }
  ]
},
"systemData": {
…
},
"tags": null,
"type":
"microsoft.hybridcontainerservice/provisionedclusterinstances/agentpools",
"vmSize": "Standard\_A4\_v2"
}

指定部署至節點集區的最大 Pod

您可以在叢集建立期間或建立新的節點集區時,設定可部署至節點的最大 Pod。 如果您未指定 maxPods 建立節點集區時,您的節點集區會部署預設值上限為 110 個 Pod:

az aksarc nodepool add --cluster-name <cluster name> -n <node pool name> -g <resource group> --max-pods 50 --yes

調整節點集區

您可以在節點集區中相應增加或減少節點數目。

若要調整節點集區的節點數量,請使用 az aksarc nodepool scale 命令。 下列範例會將名為 nodepool1的節點集區中的節點數目調整為 2:

az aksarc nodepool scale --cluster-name <cluster name> -n nodepool1 -g <resource group> --node-count 2 --yes

刪除節點集區

如果您需要刪除節點集區,請使用 az aksarc nodepool delete 命令:

az aksarc nodepool delete --cluster-name <cluster name> -n <node pool name> -g <resource group> --yes

下一步