指定したマネージド クラスター内のエージェント プールを作成または更新します。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}?api-version=2026-05-01
URI パラメーター
| 名前 |
/ |
必須 |
型 |
説明 |
|
agentPoolName
|
path |
True
|
string
minLength: 1 maxLength: 12 pattern: ^[a-z][a-z0-9]{0,11}$
|
エージェント プールの名前。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
リソース グループの名前。 名前は大文字と小文字を区別しません。
|
|
resourceName
|
path |
True
|
string
minLength: 1 maxLength: 63 pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$
|
管理対象クラスター・リソースの名前。
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ターゲット サブスクリプションの ID。 値は UUID である必要があります。
|
|
api-version
|
query |
True
|
string
minLength: 1
|
この操作に使用する API バージョン。
|
| 名前 |
必須 |
型 |
説明 |
|
if-match
|
|
string
|
要求は、エンティティがこの文字列と一致する場合にのみ続行する必要があります。
|
|
if-none-match
|
|
string
|
要求は、この文字列に一致するエンティティがない場合にのみ続行する必要があります。
|
要求本文
| 名前 |
型 |
説明 |
|
properties.artifactStreamingProfile
|
AgentPoolArtifactStreamingProfile
|
AKS でアーティファクト ストリーミングを使用するための構成。
|
|
properties.availabilityZones
|
string[]
|
ノードに使用する可用性ゾーンの一覧。 これは、AgentPoolType プロパティが 'VirtualMachineScaleSets' の場合にのみ指定できます。
|
|
properties.capacityReservationGroupID
|
string
(arm-id)
|
Capacity Reservation Groupの完全限定リソースID(Capacity Reservation Group)は、予約済みの仮想マシン群から仮想マシンを提供します。 これは「/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' の形式です。顧客はこれを使い、指定されたCRGでエージェントプールを作成します。 詳細については「キャパシティリザベーション」をご覧ください。
|
|
properties.count
|
integer
(int32)
|
Docker コンテナーをホストするエージェント (VM) の数。 使用できる値は、ユーザー プールの場合は 0 から 1000 (含む) の範囲、システム プールの場合は 1 から 1000 (含む) の範囲である必要があります。 既定値は 1です。
|
|
properties.creationData
|
CreationData
|
スナップショットを使用してノード プールを作成またはアップグレードする場合に、ソース スナップショット ID を指定するために使用する CreationData。
|
|
properties.enableAutoScaling
|
boolean
|
自動スケーラーを有効にするかどうか
|
|
properties.enableEncryptionAtHost
|
boolean
|
ホスト ベースの OS とデータ ドライブの暗号化を有効にするかどうか。 これは、特定の VM サイズと特定の Azure リージョンでのみサポートされます。 詳細については、以下を参照してください。 https://docs.microsoft.com/azure/aks/enable-host-encryption
|
|
properties.enableFIPS
|
boolean
|
FIPS 対応 OS を使用するかどうか。 詳細については 、FIPS 対応ノード プールの追加 を参照してください。
|
|
properties.enableNodePublicIP
|
boolean
|
各ノードに独自のパブリック IP が割り当てられているかどうか。 シナリオによっては、ノード プール内のノードが独自の専用パブリック IP アドレスを受け取る必要がある場合があります。 一般的なシナリオは、ホップを最小限に抑えるために、コンソールがクラウド仮想マシンに直接接続する必要があるゲーム ワークロードです。 詳細については、 ノードごとのパブリック IP の割り当てを参照してください。 既定値は false です。
|
|
properties.enableUltraSSD
|
boolean
|
UltraSSD を有効にするかどうか
|
|
properties.gatewayProfile
|
AgentPoolGatewayProfile
|
ゲートウェイ モードのマネージド エージェント プールに固有のプロファイル。 エージェント プール モードがゲートウェイでない場合は、このフィールドを設定できません。
|
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
サポートされている GPU VM SKU の GPU MIG インスタンス プロファイルを指定するために使用される GPUInstanceProfile。
|
|
properties.gpuProfile
|
GPUProfile
|
エージェント プールの GPU 設定。
|
|
properties.hostGroupID
|
string
(arm-id)
|
仮想マシンをプロビジョニングする専用ホスト グループの完全修飾リソース ID。作成シナリオでのみ使用され、設定後の変更は許可されません。 形式は /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}です。 詳細については、 Azure 専用ホストに関するページを参照してください。
|
|
properties.kubeletConfig
|
KubeletConfig
|
エージェント プール ノード上の Kubelet 構成。
|
|
properties.kubeletDiskType
|
KubeletDiskType
|
emptyDir ボリューム、コンテナー ランタイム データ ルート、および Kubelet エフェメラル ストレージの配置を決定します。
|
|
properties.linuxOSConfig
|
LinuxOSConfig
|
Linux エージェント ノードの OS 構成。
|
|
properties.localDNSProfile
|
LocalDNSProfile
|
ノードごとのローカル DNS を VnetDNS と KubeDNS のオーバーライドを使用して構成します。 LocalDNS は、AKS クラスターでの DNS 解決のパフォーマンスと信頼性を向上させるのに役立ちます。 詳細については、「aka.ms/aks/localdns」を参照してください。
|
|
properties.maxCount
|
integer
(int32)
|
自動スケーリングのノードの最大数
|
|
properties.maxPods
|
integer
(int32)
|
ノードで実行できるポッドの最大数。
|
|
properties.messageOfTheDay
|
string
|
Base64 でエンコードされた Linux ノードの日のメッセージ。 デコード後に /etc/motd に書き込まれる base64 でエンコードされた文字列。 これにより、Linux ノードに対するその日のメッセージをカスタマイズできます。 Windows ノードには指定しないでください。 静的文字列である必要があります (つまり、生で出力され、スクリプトとして実行されません)。
|
|
properties.minCount
|
integer
(int32)
|
自動スケーリング用のノードの最小数
|
|
properties.mode
|
AgentPoolMode
|
エージェント プールのモード。 クラスターには、常に少なくとも 1 つの "システム" エージェント プールが必要です。 エージェント プールの制限とベスト プラクティスの詳細については、「https://docs.microsoft.com/azure/aks/use-system-pools」を参照してください。
|
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
エージェント プールのネットワーク関連の設定。
|
|
properties.nodeImageVersion
|
string
|
ノードイメージのバージョンです。 この値を設定するとagentPoolのロールバックがトリガーされます。
recentlyUsedVersionsの値のみが許可されています。
|
|
properties.nodeLabels
|
object
|
エージェント プール内のすべてのノードにわたって保持されるノード ラベル。
|
|
properties.nodePublicIPPrefixID
|
string
(arm-id)
|
VM ノードが IP を使用するパブリック IP プレフィックス ID。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} の形式です。
|
|
properties.nodeTaints
|
string[]
|
ノード プールの作成とスケーリング中に新しいノードに追加されたテイント。 たとえば、key=value:NoSchedule です。
|
|
properties.orchestratorVersion
|
string
|
ユーザーによって指定された Kubernetes のバージョン。 パッチ バージョン <major.minor.patch> (例: 1.20.13) と <major.minor> (例: 1.20) がサポートされています。
<major.minor>を指定すると、サポートされている最新の GA パッチ バージョンが自動的に選択されます。 クラスターの作成後に同じ <major.minor> を更新しても (例: 1.14.x -> 1.14)、新しいパッチ バージョンが使用可能な場合でも、アップグレードはトリガーされません。 ベスト プラクティスとして、AKS クラスター内のすべてのノード プールを同じ Kubernetes バージョンにアップグレードする必要があります。 ノード プールのバージョンには、コントロール プレーンと同じメジャー バージョンが必要です。 ノード プールのマイナー バージョンは、コントロール プレーン バージョンの 2 つのマイナー バージョン内にある必要があります。 ノード プールのバージョンをコントロール プレーンのバージョンより大きくすることはできません。 詳細については、 ノード・プールのアップグレードを参照してください。
|
|
properties.osDiskSizeGB
|
integer
(int32)
minimum: 0 maximum: 2048
|
マスター/エージェント プール内のすべてのマシンのディスク サイズを指定するために使用する OS ディスク サイズ (GB)。 0 を指定すると、指定された vmSize に従って既定の osDisk サイズが適用されます。
|
|
properties.osDiskType
|
OSDiskType
|
エージェント プール内のマシンに使用する OS ディスクの種類。 VM でサポートされていて、要求された OSDiskSizeGB より大きいキャッシュ ディスクがある場合、既定値は "エフェメラル" です。 それ以外の場合、既定値は 'Managed' です。 作成後に変更できない場合があります。 詳細については、「エフェメラル OS を参照してください。
|
|
properties.osSKU
|
OSSKU
|
エージェント プールで使用される OS SKU を指定します。 OSType が Linux の場合、既定値は Ubuntu です。 OSType が Windows の場合、Kubernetes <= 1.24 の場合は Windows 2019、Kubernetes >= 1.25 の場合は Windows2022 が既定値です。
|
|
properties.osType
|
OSType
|
オペレーティング システムの種類。 既定値は Linux です。
|
|
properties.podIPAllocationMode
|
PodIPAllocationMode
|
ポッド IP 割り当てモード。 エージェント プール内のポッドの IP 割り当てモード。 podSubnetId と共に使用する必要があります。 既定値は "DynamicIndividual" です。
|
|
properties.podSubnetID
|
string
(arm-id)
|
起動時にポッドが参加するサブネットの ID。 省略すると、ポッド IP はノード サブネットに静的に割り当てられます (詳細については、vnetSubnetID を参照してください)。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} の形式です。
|
|
properties.powerState
|
PowerState
|
エージェント プールが実行中か停止しているか。 エージェント プールが最初に作成されるときは、最初に実行中です。 エージェント プールは、このフィールドを [停止済み] に設定することで停止できます。 停止したエージェント プールは、すべての VM を停止し、課金料金は発生しません。 エージェント プールは、実行中でプロビジョニング状態が成功した場合にのみ停止できます
|
|
properties.proximityPlacementGroupID
|
string
(arm-id)
|
近接通信配置グループの ID。
|
|
properties.scaleDownMode
|
ScaleDownMode
|
エージェント プールをスケーリングするときに使用するスケール ダウン モード。 これは、クラスターオートスケーラーの動作にも影響します。 指定しない場合は、既定で Delete に設定されます。
|
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
仮想マシン スケール セットの削除ポリシー。 削除ポリシーは、VMが削除されたときにVMをどうするかを指定します。 デフォルトは [削除] です。 削除の詳細については、「スポット VM」を参照してください
|
|
properties.scaleSetPriority
|
ScaleSetPriority
|
仮想マシン スケール セットの優先順位。
|
|
properties.securityProfile
|
AgentPoolSecurityProfile
|
エージェント プールのセキュリティ設定。
|
|
properties.spotMaxPrice
|
number
(float)
|
スポット インスタンスに対して支払う最大価格 (米ドル)。 使用できる値は、0 より大きい任意の 10 進値、または既定の価格がオンデマンドで up-to されることを示す -1 です。 指定できる値は、0 より大きい任意の 10 進値またはオンデマンド価格を支払う意欲を示す -1 です。 スポット価格の詳細については、スポット VM の価格に関するページを参照してください。
|
|
properties.status
|
AgentPoolStatus
|
エージェント プールに関する読み取り専用情報が含まれています。
|
|
properties.tags
|
object
|
エージェント プールの仮想マシン スケール セットに保持されるタグ。
|
|
properties.type
|
AgentPoolType
|
エージェント プールの種類。
|
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
エージェント プールをアップグレードするための設定
|
|
properties.virtualMachineNodesStatus
|
VirtualMachineNodes[]
|
VirtualMachines エージェント プール内のノードの状態。
|
|
properties.virtualMachinesProfile
|
VirtualMachinesProfile
|
VirtualMachines エージェント プールの仕様。
|
|
properties.vmSize
|
string
|
エージェント プール VM のサイズ。 VM サイズの可用性はリージョンによって異なります。 ノードに十分なコンピューティング リソース (メモリ、cpu など) が含まれている場合、ポッドが正常に実行されない可能性があります。 制限付き VM サイズの詳細については、「https://docs.microsoft.com/azure/aks/quotas-skus-regions」を参照してください。
|
|
properties.vnetSubnetID
|
string
(arm-id)
|
エージェント プール ノードと必要に応じてポッドが起動時に参加するサブネットの ID。 これが指定されていない場合は、VNET とサブネットが生成されて使用されます。 podSubnetID が指定されていない場合、これはノードとポッドに適用され、それ以外の場合はノードのみに適用されます。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} の形式です。
|
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
Windows エージェント プールの特定のプロファイル。
|
|
properties.workloadRuntime
|
WorkloadRuntime
|
ノードが実行できるワークロードの種類を決定します。
|
応答
| 名前 |
型 |
説明 |
|
200 OK
|
AgentPool
|
リソース 'AgentPool' 更新操作に成功しました
|
|
201 Created
|
AgentPool
|
リソース 'AgentPool' の作成操作に成功しました
ヘッダー
- Azure-AsyncOperation: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
予期しないエラー応答。
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
| 名前 |
説明 |
|
user_impersonation
|
あなたのユーザー アカウントになりすます
|
例
Create Agent Pool using an agent pool snapshot
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"enableFIPS": true,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.CreationData;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Snapshot.json
*/
/**
* Sample code: Create Agent Pool using an agent pool snapshot.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolUsingAnAgentPoolSnapshot(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner()
.withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withEnableFips(true)
.withCreationData(new CreationData().withSourceResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_snapshot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"enableFIPS": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_Snapshot.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_Snapshot.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
CreationData: &armcontainerservice.CreationData{
SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
},
EnableFIPS: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CreationData: &armcontainerservice.CreationData{
// SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
// },
// CurrentOrchestratorVersion: to.Ptr("1.19.6"),
// EnableFIPS: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Snapshot.json
*/
async function createAgentPoolUsingAnAgentPoolSnapshot() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
creationData: {
sourceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1",
},
enableFips: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"currentOrchestratorVersion": "1.19.6",
"enableFIPS": true,
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"currentOrchestratorVersion": "1.19.6",
"enableFIPS": true,
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with Capacity Reservation Group
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_CRG.json
*/
/**
* Sample code: Create Agent Pool with Capacity Reservation Group.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithCapacityReservationGroup(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner()
.withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withCapacityReservationGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_crg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_CRG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_CRG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityReservationGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_CRG.json
*/
async function createAgentPoolWithCapacityReservationGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
capacityReservationGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
count: 3,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with Dedicated Host Group
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_DedicatedHostGroup.json
*/
/**
* Sample code: Create Agent Pool with Dedicated Host Group.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithDedicatedHostGroup(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner()
.withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withHostGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_dedicated_host_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_DedicatedHostGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_DedicatedHostGroup.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_DedicatedHostGroup.json
*/
async function createAgentPoolWithDedicatedHostGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
hostGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with EncryptionAtHost enabled
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"enableEncryptionAtHost": true,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableEncryptionAtHost.json
*/
/**
* Sample code: Create Agent Pool with EncryptionAtHost enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithEncryptionAtHostEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("").withEnableEncryptionAtHost(true),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_encryption_at_host.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableEncryptionAtHost": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableEncryptionAtHost.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_EnableEncryptionAtHost.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.13"),
// EnableEncryptionAtHost: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.13"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableEncryptionAtHost.json
*/
async function createAgentPoolWithEncryptionAtHostEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
enableEncryptionAtHost: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.13",
"enableEncryptionAtHost": true,
"maxPods": 110,
"orchestratorVersion": "1.17.13",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.13",
"enableEncryptionAtHost": true,
"maxPods": 110,
"orchestratorVersion": "1.17.13",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with Ephemeral OS Disk
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osDiskType": "Ephemeral",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSDiskType;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Ephemeral.json
*/
/**
* Sample code: Create Agent Pool with Ephemeral OS Disk.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithEphemeralOSDisk(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsDiskSizeGB(64)
.withOsDiskType(OSDiskType.EPHEMERAL).withOsType(OSType.LINUX).withOrchestratorVersion(""),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ephemeral.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osDiskType": "Ephemeral",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_Ephemeral.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_Ephemeral.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOSDisk() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSDiskSizeGB: to.Ptr[int32](64),
OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSDiskSizeGB: to.Ptr[int32](64),
// OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Ephemeral.json
*/
async function createAgentPoolWithEphemeralOSDisk() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
orchestratorVersion: "",
osDiskSizeGB: 64,
osDiskType: "Ephemeral",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osDiskType": "Ephemeral",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"kubeletDiskType": "OS",
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osDiskType": "Ephemeral",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with FIPS enabled OS
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"enableFIPS": true,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableFIPS.json
*/
/**
* Sample code: Create Agent Pool with FIPS enabled OS.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithFIPSEnabledOS(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableFips(true),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_fips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableFIPS": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableFIPS.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_EnableFIPS.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOS() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableFIPS: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.19.6"),
// EnableFIPS: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableFIPS.json
*/
async function createAgentPoolWithFipsEnabledOS() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
enableFips: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.19.6",
"enableFIPS": true,
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.19.6",
"enableFIPS": true,
"maxPods": 110,
"orchestratorVersion": "1.19.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with GPUMIG
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_ND96asr_v4"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.GpuInstanceProfile;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_GPUMIG.json
*/
/**
* Sample code: Create Agent Pool with GPUMIG.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithGPUMIG(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_ND96asr_v4").withOsType(OSType.LINUX)
.withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500))
.withGpuInstanceProfile(GpuInstanceProfile.MIG2G),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_gpumig.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_ND96asr_v4",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_GPUMIG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_GPUMIG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn"),
},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_ND96asr_v4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn"),
// },
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_ND96asr_v4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_GPUMIG.json
*/
async function createAgentPoolWithGpumig() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
gpuInstanceProfile: "MIG2g",
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_ND96asr_v4",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_ND96asr_v4"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"podMaxPids": 100,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 65536,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_ND96asr_v4"
}
}
Create Agent Pool with Krustlet and the WASI runtime
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"mode": "User",
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
"workloadRuntime": "WasmWasi"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.WorkloadRuntime;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WasmWasi.json
*/
/**
* Sample code: Create Agent Pool with Krustlet and the WASI runtime.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithKrustletAndTheWASIRuntime(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsDiskSizeGB(64)
.withWorkloadRuntime(WorkloadRuntime.WASM_WASI).withOsType(OSType.LINUX).withMode(AgentPoolMode.USER)
.withOrchestratorVersion(""),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_wasm_wasi.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"mode": "User",
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
"workloadRuntime": "WasmWasi",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_WasmWasi.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_WasmWasi.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
OrchestratorVersion: to.Ptr(""),
OSDiskSizeGB: to.Ptr[int32](64),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSDiskSizeGB: to.Ptr[int32](64),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WasmWasi.json
*/
async function createAgentPoolWithKrustletAndTheWasiRuntime() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
mode: "User",
orchestratorVersion: "",
osDiskSizeGB: 64,
osType: "Linux",
vmSize: "Standard_DS2_v2",
workloadRuntime: "WasmWasi",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"maxPods": 110,
"mode": "User",
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2",
"workloadRuntime": "WasmWasi"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"maxPods": 110,
"mode": "User",
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2",
"workloadRuntime": "WasmWasi"
}
}
Create Agent Pool with KubeletConfig and LinuxOSConfig
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_CustomNodeConfig.json
*/
/**
* Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_custom_node_config.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_CustomNodeConfig.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_CustomNodeConfig.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOSConfig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn"),
},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn"),
// },
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_CustomNodeConfig.json
*/
async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"podMaxPids": 100,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 65536,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with Message of the Day
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"messageOfTheDay": "Zm9vCg==",
"mode": "User",
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_MessageOfTheDay.json
*/
/**
* Sample code: Create Agent Pool with Message of the Day.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithMessageOfTheDay(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsDiskSizeGB(64)
.withMessageOfTheDay("Zm9vCg==").withOsType(OSType.LINUX).withMode(AgentPoolMode.USER)
.withOrchestratorVersion(""),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_message_of_the_day.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"messageOfTheDay": "Zm9vCg==",
"mode": "User",
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_MessageOfTheDay.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_MessageOfTheDay.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithMessageOfTheDay() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
MessageOfTheDay: to.Ptr("Zm9vCg=="),
Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
OrchestratorVersion: to.Ptr(""),
OSDiskSizeGB: to.Ptr[int32](64),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// MaxPods: to.Ptr[int32](110),
// MessageOfTheDay: to.Ptr("Zm9vCg=="),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSDiskSizeGB: to.Ptr[int32](64),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_MessageOfTheDay.json
*/
async function createAgentPoolWithMessageOfTheDay() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
messageOfTheDay: "Zm9vCg==",
mode: "User",
orchestratorVersion: "",
osDiskSizeGB: 64,
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"maxPods": 110,
"messageOfTheDay": "Zm9vCg==",
"mode": "User",
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"maxPods": 110,
"messageOfTheDay": "Zm9vCg==",
"mode": "User",
"orchestratorVersion": "1.17.8",
"osDiskSizeGB": 64,
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with OSSKU
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"orchestratorVersion": "",
"osSKU": "AzureLinux",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_OSSKU.json
*/
/**
* Sample code: Create Agent Pool with OSSKU.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithOSSKU(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOsSku(OSSku.AZURE_LINUX).withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ossku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osSKU": "AzureLinux",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_OSSKU.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_OSSKU.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn"),
},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn"),
// },
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_OSSKU.json
*/
async function createAgentPoolWithOssku() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osSKU: "AzureLinux",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osSKU": "AzureLinux",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.8",
"kubeletConfig": {
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": false,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"podMaxPids": 100,
"topologyManagerPolicy": "best-effort"
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 65536,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": true
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always"
},
"maxPods": 110,
"orchestratorVersion": "1.17.8",
"osSKU": "AzureLinux",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with PPG
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_PPG.json
*/
/**
* Sample code: Create Agent Pool with PPG.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithPPG(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner()
.withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withProximityPlacementGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ppg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_PPG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_PPG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_PPG.json
*/
async function createAgentPoolWithPPG() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
orchestratorVersion: "",
osType: "Linux",
proximityPlacementGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with UltraSSD enabled
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"enableUltraSSD": true,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableUltraSSD.json
*/
/**
* Sample code: Create Agent Pool with UltraSSD enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithUltraSSDEnabled(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableUltraSsd(true),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_ultra_ssd.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableUltraSSD": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableUltraSSD.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_EnableUltraSSD.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableUltraSSD: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.13"),
// EnableUltraSSD: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.13"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_EnableUltraSSD.json
*/
async function createAgentPoolWithUltraSSDEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
enableUltraSSD: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.13",
"enableUltraSSD": true,
"maxPods": 110,
"orchestratorVersion": "1.17.13",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.17.13",
"enableUltraSSD": true,
"maxPods": 110,
"orchestratorVersion": "1.17.13",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
}
Create Agent Pool with VirtualMachines pool type
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"type": "VirtualMachines",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"count": 3,
"size": "Standard_D2_v2"
},
{
"count": 2,
"size": "Standard_D2_v3"
}
]
}
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ManualScaleProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleProfile;
import com.azure.resourcemanager.containerservice.models.VirtualMachinesProfile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines.json
*/
/**
* Sample code: Create Agent Pool with VirtualMachines pool type.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithVirtualMachinesPoolType(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withOsType(OSType.LINUX).withTypePropertiesType(AgentPoolType.VIRTUAL_MACHINES)
.withOrchestratorVersion("1.9.6").withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule"))
.withVirtualMachinesProfile(new VirtualMachinesProfile().withScale(new ScaleProfile()
.withManual(Arrays.asList(new ManualScaleProfile().withSize("Standard_D2_v2").withCount(3),
new ManualScaleProfile().withSize("Standard_D2_v3").withCount(2))))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_type_virtual_machines.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"tags": {"name1": "val1"},
"type": "VirtualMachines",
"virtualMachinesProfile": {
"scale": {
"manual": [{"count": 3, "size": "Standard_D2_v2"}, {"count": 2, "size": "Standard_D2_v3"}]
}
},
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithVirtualMachinesPoolType() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule"),
},
OrchestratorVersion: to.Ptr("1.9.6"),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{
Scale: &armcontainerservice.ScaleProfile{
Manual: []*armcontainerservice.ManualScaleProfile{
{
Count: to.Ptr[int32](3),
Size: to.Ptr("Standard_D2_v2"),
},
{
Count: to.Ptr[int32](2),
Size: to.Ptr("Standard_D2_v3"),
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule"),
// },
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VirtualMachineNodesStatus: []*armcontainerservice.VirtualMachineNodes{
// {
// Count: to.Ptr[int32](3),
// Size: to.Ptr("Standard_D2_v2"),
// },
// {
// Count: to.Ptr[int32](2),
// Size: to.Ptr("Standard_D2_v3"),
// },
// },
// VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{
// Scale: &armcontainerservice.ScaleProfile{
// Manual: []*armcontainerservice.ManualScaleProfile{
// {
// Count: to.Ptr[int32](3),
// Size: to.Ptr("Standard_D2_v2"),
// },
// {
// Count: to.Ptr[int32](2),
// Size: to.Ptr("Standard_D2_v3"),
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines.json
*/
async function createAgentPoolWithVirtualMachinesPoolType() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
typePropertiesType: "VirtualMachines",
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "1.9.6",
osType: "Linux",
tags: { name1: "val1" },
virtualMachinesProfile: {
scale: {
manual: [
{ count: 3, size: "Standard_D2_v2" },
{ count: 2, size: "Standard_D2_v3" },
],
},
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"type": "VirtualMachines",
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"tags": {
"name1": "val1"
},
"virtualMachineNodesStatus": [
{
"count": 3,
"size": "Standard_D2_v2"
},
{
"count": 2,
"size": "Standard_D2_v3"
}
],
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"count": 3,
"size": "Standard_D2_v2"
},
{
"count": 2,
"size": "Standard_D2_v3"
}
]
}
}
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"type": "VirtualMachines",
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"tags": {
"name1": "val1"
},
"virtualMachineNodesStatus": [
{
"count": 3,
"size": "Standard_D2_v2"
},
{
"count": 2,
"size": "Standard_D2_v3"
}
],
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"count": 3,
"size": "Standard_D2_v2"
},
{
"count": 2,
"size": "Standard_D2_v3"
}
]
}
}
}
}
Create Agent Pool with VirtualMachines pool type with autoscaling enabled
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"type": "VirtualMachines",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.29.0",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"virtualMachinesProfile": {
"scale": {
"autoscale": [
{
"maxCount": 5,
"minCount": 1,
"size": "Standard_D2_v2"
}
]
}
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.AutoScaleProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleProfile;
import com.azure.resourcemanager.containerservice.models.VirtualMachinesProfile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json
*/
/**
* Sample code: Create Agent Pool with VirtualMachines pool type with autoscaling enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createAgentPoolWithVirtualMachinesPoolTypeWithAutoscalingEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withOsType(OSType.LINUX).withTypePropertiesType(AgentPoolType.VIRTUAL_MACHINES)
.withOrchestratorVersion("1.29.0").withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule"))
.withVirtualMachinesProfile(new VirtualMachinesProfile().withScale(new ScaleProfile().withAutoscale(
Arrays.asList(new AutoScaleProfile().withSize("Standard_D2_v2").withMinCount(1).withMaxCount(5))))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_type_virtual_machines_autoscale.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "1.29.0",
"osType": "Linux",
"tags": {"name1": "val1"},
"type": "VirtualMachines",
"virtualMachinesProfile": {
"scale": {"autoscale": [{"maxCount": 5, "minCount": 1, "size": "Standard_D2_v2"}]}
},
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithVirtualMachinesPoolTypeWithAutoscalingEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule"),
},
OrchestratorVersion: to.Ptr("1.29.0"),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{
Scale: &armcontainerservice.ScaleProfile{
Autoscale: []*armcontainerservice.AutoScaleProfile{
{
MaxCount: to.Ptr[int32](5),
MinCount: to.Ptr[int32](1),
Size: to.Ptr("Standard_D2_v2"),
},
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines),
// CurrentOrchestratorVersion: to.Ptr("1.29.0"),
// MaxPods: to.Ptr[int32](110),
// NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule"),
// },
// OrchestratorVersion: to.Ptr("1.29.0"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VirtualMachineNodesStatus: []*armcontainerservice.VirtualMachineNodes{
// {
// Count: to.Ptr[int32](1),
// Size: to.Ptr("Standard_D2_v2"),
// },
// },
// VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{
// Scale: &armcontainerservice.ScaleProfile{
// Autoscale: []*armcontainerservice.AutoScaleProfile{
// {
// MaxCount: to.Ptr[int32](5),
// MinCount: to.Ptr[int32](1),
// Size: to.Ptr("Standard_D2_v2"),
// },
// },
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json
*/
async function createAgentPoolWithVirtualMachinesPoolTypeWithAutoscalingEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
typePropertiesType: "VirtualMachines",
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "1.29.0",
osType: "Linux",
tags: { name1: "val1" },
virtualMachinesProfile: {
scale: { autoscale: [{ maxCount: 5, minCount: 1, size: "Standard_D2_v2" }] },
},
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"type": "VirtualMachines",
"currentOrchestratorVersion": "1.29.0",
"maxPods": 110,
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.29.0",
"osType": "Linux",
"provisioningState": "Succeeded",
"tags": {
"name1": "val1"
},
"virtualMachineNodesStatus": [
{
"count": 1,
"size": "Standard_D2_v2"
}
],
"virtualMachinesProfile": {
"scale": {
"autoscale": [
{
"maxCount": 5,
"minCount": 1,
"size": "Standard_D2_v2"
}
]
}
}
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"type": "VirtualMachines",
"currentOrchestratorVersion": "1.29.0",
"maxPods": 110,
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.29.0",
"osType": "Linux",
"provisioningState": "Creating",
"tags": {
"name1": "val1"
},
"virtualMachineNodesStatus": [
{
"count": 1,
"size": "Standard_D2_v2"
}
],
"virtualMachinesProfile": {
"scale": {
"autoscale": [
{
"maxCount": 5,
"minCount": 1,
"size": "Standard_D2_v2"
}
]
}
}
}
}
Create Agent Pool with Windows OSSKU
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2026-05-01
{
"properties": {
"count": 3,
"orchestratorVersion": "1.23.3",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsOSSKU.json
*/
/**
* Sample code: Create Agent Pool with Windows OSSKU.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createAgentPoolWithWindowsOSSKU(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "wnp2",
new AgentPoolInner().withCount(3).withVmSize("Standard_D4s_v3").withOsType(OSType.WINDOWS)
.withOsSku(OSSku.WINDOWS2022).withOrchestratorVersion("1.23.3"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_windows_ossku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="wnp2",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "1.23.3",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsOSSKU.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_WindowsOSSKU.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "wnp2", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr("1.23.3"),
OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
OSType: to.Ptr(armcontainerservice.OSTypeWindows),
VMSize: to.Ptr("Standard_D4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("wnp2"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.23.3"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.23.3"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
// OSType: to.Ptr(armcontainerservice.OSTypeWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_D4s_v3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsOSSKU.json
*/
async function createAgentPoolWithWindowsOssku() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "wnp2", {
count: 3,
orchestratorVersion: "1.23.3",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.23.3",
"maxPods": 110,
"orchestratorVersion": "1.23.3",
"osSKU": "Windows2022",
"osType": "Windows",
"provisioningState": "Succeeded",
"vmSize": "Standard_D4s_v3"
}
}
{
"name": "wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.23.3",
"maxPods": 110,
"orchestratorVersion": "1.23.3",
"osSKU": "Windows2022",
"osType": "Windows",
"provisioningState": "Creating",
"vmSize": "Standard_D4s_v3"
}
}
Create Spot Agent Pool
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Spot.json
*/
/**
* Sample code: Create Spot Agent Pool.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createSpotAgentPool(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("").withScaleSetPriority(ScaleSetPriority.SPOT)
.withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE).withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_spot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {"name1": "val1"},
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_Spot.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_Spot.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule"),
// },
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// SpotMaxPrice: to.Ptr[float32](-1),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Spot.json
*/
async function createSpotAgentPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
tags: { name1: "val1" },
vmSize: "Standard_DS1_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"spotMaxPrice": -1,
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"spotMaxPrice": -1,
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
Create Windows Agent Pool with disabling OutboundNAT
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2026-05-01
{
"properties": {
"count": 3,
"orchestratorVersion": "1.23.8",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json
*/
/**
* Sample code: Create Windows Agent Pool with disabling OutboundNAT.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createWindowsAgentPoolWithDisablingOutboundNAT(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "wnp2",
new AgentPoolInner().withCount(3).withVmSize("Standard_D4s_v3").withOsType(OSType.WINDOWS)
.withOsSku(OSSku.WINDOWS2022).withOrchestratorVersion("1.23.8")
.withWindowsProfile(new AgentPoolWindowsProfile().withDisableOutboundNat(true)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_windows_disable_outbound_nat.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="wnp2",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "1.23.8",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3",
"windowsProfile": {"disableOutboundNat": True},
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisablingOutboundNat() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "wnp2", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr("1.23.8"),
OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
OSType: to.Ptr(armcontainerservice.OSTypeWindows),
VMSize: to.Ptr("Standard_D4s_v3"),
WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{
DisableOutboundNat: to.Ptr(true),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("wnp2"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.23.8"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.23.8"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
// OSType: to.Ptr(armcontainerservice.OSTypeWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_D4s_v3"),
// WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{
// DisableOutboundNat: to.Ptr(true),
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_WindowsDisableOutboundNAT.json
*/
async function createWindowsAgentPoolWithDisablingOutboundNAT() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "wnp2", {
count: 3,
orchestratorVersion: "1.23.8",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
windowsProfile: { disableOutboundNat: true },
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.23.8",
"maxPods": 110,
"orchestratorVersion": "1.23.8",
"osSKU": "Windows2022",
"osType": "Windows",
"provisioningState": "Succeeded",
"vmSize": "Standard_D4s_v3",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
{
"name": "wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.23.8",
"maxPods": 110,
"orchestratorVersion": "1.23.8",
"osSKU": "Windows2022",
"osType": "Windows",
"provisioningState": "Creating",
"vmSize": "Standard_D4s_v3",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
Create/Update Agent Pool
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"mode": "User",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Update.json
*/
/**
* Sample code: Create/Update Agent Pool.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createUpdateAgentPool(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withMode(AgentPoolMode.USER).withOrchestratorVersion("").withScaleSetPriority(ScaleSetPriority.SPOT)
.withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE).withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"mode": "User",
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {"name1": "val1"},
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPoolsCreate_Update.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPoolsCreate_Update.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule"),
// },
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPoolsCreate_Update.json
*/
async function createOrUpdateAgentPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
mode: "User",
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
tags: { name1: "val1" },
vmSize: "Standard_DS1_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"mode": "User",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"mode": "User",
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {
"name1": "val1"
},
"vmSize": "Standard_DS1_v2"
}
}
Start Agent Pool
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"powerState": {
"code": "Running"
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.Code;
import com.azure.resourcemanager.containerservice.models.PowerState;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPools_Start.json
*/
/**
* Sample code: Start Agent Pool.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void startAgentPool(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withPowerState(new PowerState().withCode(Code.RUNNING)), null, null,
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_start.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={"properties": {"powerState": {"code": "Running"}}},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPools_Start.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPools_Start.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
PowerState: &armcontainerservice.PowerState{
Code: to.Ptr(armcontainerservice.CodeRunning),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](50),
// EnableAutoScaling: to.Ptr(true),
// MaxCount: to.Ptr[int32](55),
// MinCount: to.Ptr[int32](3),
// PowerState: &armcontainerservice.PowerState{
// Code: to.Ptr(armcontainerservice.CodeRunning),
// },
// ProvisioningState: to.Ptr("Starting"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPools_Start.json
*/
async function startAgentPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
powerState: { code: "Running" },
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 50,
"enableAutoScaling": true,
"maxCount": 55,
"minCount": 3,
"powerState": {
"code": "Running"
},
"provisioningState": "Starting"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 50,
"enableAutoScaling": true,
"maxCount": 55,
"minCount": 3,
"powerState": {
"code": "Running"
},
"provisioningState": "Starting"
}
}
Stop Agent Pool
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"powerState": {
"code": "Stopped"
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.Code;
import com.azure.resourcemanager.containerservice.models.PowerState;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPools_Stop.json
*/
/**
* Sample code: Stop Agent Pool.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void stopAgentPool(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withPowerState(new PowerState().withCode(Code.STOPPED)), null, null,
com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_stop.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={"properties": {"powerState": {"code": "Stopped"}}},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPools_Stop.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPools_Stop.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
PowerState: &armcontainerservice.PowerState{
Code: to.Ptr(armcontainerservice.CodeStopped),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](0),
// EnableAutoScaling: to.Ptr(false),
// PowerState: &armcontainerservice.PowerState{
// Code: to.Ptr(armcontainerservice.CodeStopped),
// },
// ProvisioningState: to.Ptr("Stopping"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPools_Stop.json
*/
async function stopAgentPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
powerState: { code: "Stopped" },
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 0,
"enableAutoScaling": false,
"powerState": {
"code": "Stopped"
},
"provisioningState": "Stopping"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 0,
"enableAutoScaling": false,
"powerState": {
"code": "Stopped"
},
"provisioningState": "Stopping"
}
}
Update Agent Pool
要求のサンプル
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2026-05-01
{
"properties": {
"count": 3,
"enableAutoScaling": true,
"maxCount": 2,
"minCount": 2,
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"vmSize": "Standard_DS1_v2"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-05-01/AgentPools_Update.json
*/
/**
* Sample code: Update Agent Pool.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void updateAgentPool(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1", "agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX).withMaxCount(2)
.withMinCount(2).withEnableAutoScaling(true).withOrchestratorVersion("")
.withScaleSetPriority(ScaleSetPriority.SPOT).withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE)
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableAutoScaling": True,
"maxCount": 2,
"minCount": 2,
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: 2026-05-01/AgentPools_Update.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-05-01/AgentPools_Update.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableAutoScaling: to.Ptr(true),
MaxCount: to.Ptr[int32](2),
MinCount: to.Ptr[int32](2),
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.AgentPoolsClientCreateOrUpdateResponse{
// AgentPool: armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableAutoScaling: to.Ptr(true),
// MaxCount: to.Ptr[int32](2),
// MaxPods: to.Ptr[int32](110),
// MinCount: to.Ptr[int32](2),
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule"),
// },
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates an agent pool in the specified managed cluster.
*
* @summary creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: 2026-05-01/AgentPools_Update.json
*/
async function updateAgentPool() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.createOrUpdate("rg1", "clustername1", "agentpool1", {
count: 3,
enableAutoScaling: true,
maxCount: 2,
minCount: 2,
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
vmSize: "Standard_DS1_v2",
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
応答のサンプル
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableAutoScaling": true,
"maxCount": 2,
"maxPods": 110,
"minCount": 2,
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"vmSize": "Standard_DS1_v2"
}
}
{
"name": "agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"properties": {
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableAutoScaling": true,
"maxCount": 2,
"maxPods": 110,
"minCount": 2,
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Updating",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"vmSize": "Standard_DS1_v2"
}
}
定義
AgentPool
Object
エージェント プール。
| 名前 |
型 |
規定値 |
説明 |
|
id
|
string
(arm-id)
|
|
リソースの完全修飾リソース ID。 例: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
|
リソースの名前
|
|
properties.artifactStreamingProfile
|
AgentPoolArtifactStreamingProfile
|
|
AKS でアーティファクト ストリーミングを使用するための構成。
|
|
properties.availabilityZones
|
string[]
|
|
ノードに使用する可用性ゾーンの一覧。 これは、AgentPoolType プロパティが 'VirtualMachineScaleSets' の場合にのみ指定できます。
|
|
properties.capacityReservationGroupID
|
string
(arm-id)
|
|
Capacity Reservation Groupの完全限定リソースID(Capacity Reservation Group)は、予約済みの仮想マシン群から仮想マシンを提供します。 これは「/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' の形式です。顧客はこれを使い、指定されたCRGでエージェントプールを作成します。 詳細については「キャパシティリザベーション」をご覧ください。
|
|
properties.count
|
integer
(int32)
|
|
Docker コンテナーをホストするエージェント (VM) の数。 使用できる値は、ユーザー プールの場合は 0 から 1000 (含む) の範囲、システム プールの場合は 1 から 1000 (含む) の範囲である必要があります。 既定値は 1です。
|
|
properties.creationData
|
CreationData
|
|
スナップショットを使用してノード プールを作成またはアップグレードする場合に、ソース スナップショット ID を指定するために使用する CreationData。
|
|
properties.currentOrchestratorVersion
|
string
|
|
エージェント プールが実行されている Kubernetes のバージョン。 orchestratorVersion が major.minor.patch<>完全に指定されたバージョンである場合、このフィールドは完全に同じになります。 orchestratorVersion が major.minor<>場合、このフィールドには、使用されている major.minor.patch< バージョン全体 >含まれます。
|
|
properties.eTag
|
string
|
|
オプティミスティック コンカレンシーを実装するために使用される一意の読み取り専用文字列。 リソースが更新されると、eTag 値が変更されます。 後続のリクエストの eTag 値を含む if-match または if-none-match ヘッダーを指定して、通常の eTag 規則に従ってオプティミスティック同時実行を有効にします。
|
|
properties.enableAutoScaling
|
boolean
|
|
自動スケーラーを有効にするかどうか
|
|
properties.enableEncryptionAtHost
|
boolean
|
|
ホスト ベースの OS とデータ ドライブの暗号化を有効にするかどうか。 これは、特定の VM サイズと特定の Azure リージョンでのみサポートされます。 詳細については、以下を参照してください。 https://docs.microsoft.com/azure/aks/enable-host-encryption
|
|
properties.enableFIPS
|
boolean
|
|
FIPS 対応 OS を使用するかどうか。 詳細については 、FIPS 対応ノード プールの追加 を参照してください。
|
|
properties.enableNodePublicIP
|
boolean
|
|
各ノードに独自のパブリック IP が割り当てられているかどうか。 シナリオによっては、ノード プール内のノードが独自の専用パブリック IP アドレスを受け取る必要がある場合があります。 一般的なシナリオは、ホップを最小限に抑えるために、コンソールがクラウド仮想マシンに直接接続する必要があるゲーム ワークロードです。 詳細については、 ノードごとのパブリック IP の割り当てを参照してください。 既定値は false です。
|
|
properties.enableUltraSSD
|
boolean
|
|
UltraSSD を有効にするかどうか
|
|
properties.gatewayProfile
|
AgentPoolGatewayProfile
|
|
ゲートウェイ モードのマネージド エージェント プールに固有のプロファイル。 エージェント プール モードがゲートウェイでない場合は、このフィールドを設定できません。
|
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
|
サポートされている GPU VM SKU の GPU MIG インスタンス プロファイルを指定するために使用される GPUInstanceProfile。
|
|
properties.gpuProfile
|
GPUProfile
|
|
エージェント プールの GPU 設定。
|
|
properties.hostGroupID
|
string
(arm-id)
|
|
仮想マシンをプロビジョニングする専用ホスト グループの完全修飾リソース ID。作成シナリオでのみ使用され、設定後の変更は許可されません。 形式は /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}です。 詳細については、 Azure 専用ホストに関するページを参照してください。
|
|
properties.kubeletConfig
|
KubeletConfig
|
|
エージェント プール ノード上の Kubelet 構成。
|
|
properties.kubeletDiskType
|
KubeletDiskType
|
|
emptyDir ボリューム、コンテナー ランタイム データ ルート、および Kubelet エフェメラル ストレージの配置を決定します。
|
|
properties.linuxOSConfig
|
LinuxOSConfig
|
|
Linux エージェント ノードの OS 構成。
|
|
properties.localDNSProfile
|
LocalDNSProfile
|
|
ノードごとのローカル DNS を VnetDNS と KubeDNS のオーバーライドを使用して構成します。 LocalDNS は、AKS クラスターでの DNS 解決のパフォーマンスと信頼性を向上させるのに役立ちます。 詳細については、「aka.ms/aks/localdns」を参照してください。
|
|
properties.maxCount
|
integer
(int32)
|
|
自動スケーリングのノードの最大数
|
|
properties.maxPods
|
integer
(int32)
|
|
ノードで実行できるポッドの最大数。
|
|
properties.messageOfTheDay
|
string
|
|
Base64 でエンコードされた Linux ノードの日のメッセージ。 デコード後に /etc/motd に書き込まれる base64 でエンコードされた文字列。 これにより、Linux ノードに対するその日のメッセージをカスタマイズできます。 Windows ノードには指定しないでください。 静的文字列である必要があります (つまり、生で出力され、スクリプトとして実行されません)。
|
|
properties.minCount
|
integer
(int32)
|
|
自動スケーリング用のノードの最小数
|
|
properties.mode
|
AgentPoolMode
|
|
エージェント プールのモード。 クラスターには、常に少なくとも 1 つの "システム" エージェント プールが必要です。 エージェント プールの制限とベスト プラクティスの詳細については、「https://docs.microsoft.com/azure/aks/use-system-pools」を参照してください。
|
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
|
エージェント プールのネットワーク関連の設定。
|
|
properties.nodeImageVersion
|
string
|
|
ノードイメージのバージョンです。 この値を設定するとagentPoolのロールバックがトリガーされます。
recentlyUsedVersionsの値のみが許可されています。
|
|
properties.nodeLabels
|
object
|
|
エージェント プール内のすべてのノードにわたって保持されるノード ラベル。
|
|
properties.nodePublicIPPrefixID
|
string
(arm-id)
|
|
VM ノードが IP を使用するパブリック IP プレフィックス ID。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} の形式です。
|
|
properties.nodeTaints
|
string[]
|
|
ノード プールの作成とスケーリング中に新しいノードに追加されたテイント。 たとえば、key=value:NoSchedule です。
|
|
properties.orchestratorVersion
|
string
|
|
ユーザーによって指定された Kubernetes のバージョン。 パッチ バージョン <major.minor.patch> (例: 1.20.13) と <major.minor> (例: 1.20) がサポートされています。
<major.minor>を指定すると、サポートされている最新の GA パッチ バージョンが自動的に選択されます。 クラスターの作成後に同じ <major.minor> を更新しても (例: 1.14.x -> 1.14)、新しいパッチ バージョンが使用可能な場合でも、アップグレードはトリガーされません。 ベスト プラクティスとして、AKS クラスター内のすべてのノード プールを同じ Kubernetes バージョンにアップグレードする必要があります。 ノード プールのバージョンには、コントロール プレーンと同じメジャー バージョンが必要です。 ノード プールのマイナー バージョンは、コントロール プレーン バージョンの 2 つのマイナー バージョン内にある必要があります。 ノード プールのバージョンをコントロール プレーンのバージョンより大きくすることはできません。 詳細については、 ノード・プールのアップグレードを参照してください。
|
|
properties.osDiskSizeGB
|
integer
(int32)
minimum: 0 maximum: 2048
|
|
マスター/エージェント プール内のすべてのマシンのディスク サイズを指定するために使用する OS ディスク サイズ (GB)。 0 を指定すると、指定された vmSize に従って既定の osDisk サイズが適用されます。
|
|
properties.osDiskType
|
OSDiskType
|
|
エージェント プール内のマシンに使用する OS ディスクの種類。 VM でサポートされていて、要求された OSDiskSizeGB より大きいキャッシュ ディスクがある場合、既定値は "エフェメラル" です。 それ以外の場合、既定値は 'Managed' です。 作成後に変更できない場合があります。 詳細については、「エフェメラル OS を参照してください。
|
|
properties.osSKU
|
OSSKU
|
|
エージェント プールで使用される OS SKU を指定します。 OSType が Linux の場合、既定値は Ubuntu です。 OSType が Windows の場合、Kubernetes <= 1.24 の場合は Windows 2019、Kubernetes >= 1.25 の場合は Windows2022 が既定値です。
|
|
properties.osType
|
OSType
|
Linux
|
オペレーティング システムの種類。 既定値は Linux です。
|
|
properties.podIPAllocationMode
|
PodIPAllocationMode
|
|
ポッド IP 割り当てモード。 エージェント プール内のポッドの IP 割り当てモード。 podSubnetId と共に使用する必要があります。 既定値は "DynamicIndividual" です。
|
|
properties.podSubnetID
|
string
(arm-id)
|
|
起動時にポッドが参加するサブネットの ID。 省略すると、ポッド IP はノード サブネットに静的に割り当てられます (詳細については、vnetSubnetID を参照してください)。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} の形式です。
|
|
properties.powerState
|
PowerState
|
|
エージェント プールが実行中か停止しているか。 エージェント プールが最初に作成されるときは、最初に実行中です。 エージェント プールは、このフィールドを [停止済み] に設定することで停止できます。 停止したエージェント プールは、すべての VM を停止し、課金料金は発生しません。 エージェント プールは、実行中でプロビジョニング状態が成功した場合にのみ停止できます
|
|
properties.provisioningState
|
string
|
|
現在のデプロイまたはプロビジョニングの状態。
|
|
properties.proximityPlacementGroupID
|
string
(arm-id)
|
|
近接通信配置グループの ID。
|
|
properties.scaleDownMode
|
ScaleDownMode
|
|
エージェント プールをスケーリングするときに使用するスケール ダウン モード。 これは、クラスターオートスケーラーの動作にも影響します。 指定しない場合は、既定で Delete に設定されます。
|
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Delete
|
仮想マシン スケール セットの削除ポリシー。 削除ポリシーは、VMが削除されたときにVMをどうするかを指定します。 デフォルトは [削除] です。 削除の詳細については、「スポット VM」を参照してください
|
|
properties.scaleSetPriority
|
ScaleSetPriority
|
Regular
|
仮想マシン スケール セットの優先順位。
|
|
properties.securityProfile
|
AgentPoolSecurityProfile
|
|
エージェント プールのセキュリティ設定。
|
|
properties.spotMaxPrice
|
number
(float)
|
-1
|
スポット インスタンスに対して支払う最大価格 (米ドル)。 使用できる値は、0 より大きい任意の 10 進値、または既定の価格がオンデマンドで up-to されることを示す -1 です。 指定できる値は、0 より大きい任意の 10 進値またはオンデマンド価格を支払う意欲を示す -1 です。 スポット価格の詳細については、スポット VM の価格に関するページを参照してください。
|
|
properties.status
|
AgentPoolStatus
|
|
エージェント プールに関する読み取り専用情報が含まれています。
|
|
properties.tags
|
object
|
|
エージェント プールの仮想マシン スケール セットに保持されるタグ。
|
|
properties.type
|
AgentPoolType
|
|
エージェント プールの種類。
|
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
|
エージェント プールをアップグレードするための設定
|
|
properties.virtualMachineNodesStatus
|
VirtualMachineNodes[]
|
|
VirtualMachines エージェント プール内のノードの状態。
|
|
properties.virtualMachinesProfile
|
VirtualMachinesProfile
|
|
VirtualMachines エージェント プールの仕様。
|
|
properties.vmSize
|
string
|
|
エージェント プール VM のサイズ。 VM サイズの可用性はリージョンによって異なります。 ノードに十分なコンピューティング リソース (メモリ、cpu など) が含まれている場合、ポッドが正常に実行されない可能性があります。 制限付き VM サイズの詳細については、「https://docs.microsoft.com/azure/aks/quotas-skus-regions」を参照してください。
|
|
properties.vnetSubnetID
|
string
(arm-id)
|
|
エージェント プール ノードと必要に応じてポッドが起動時に参加するサブネットの ID。 これが指定されていない場合は、VNET とサブネットが生成されて使用されます。 podSubnetID が指定されていない場合、これはノードとポッドに適用され、それ以外の場合はノードのみに適用されます。 これは、/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} の形式です。
|
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
|
Windows エージェント プールの特定のプロファイル。
|
|
properties.workloadRuntime
|
WorkloadRuntime
|
|
ノードが実行できるワークロードの種類を決定します。
|
|
systemData
|
systemData
|
|
createdBy および modifiedBy 情報を含む Azure Resource Manager メタデータ。
|
|
type
|
string
|
|
リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"
|
AgentPoolArtifactStreamingProfile
Object
エージェントプール用のアーティファクトストリーミングプロファイル。
| 名前 |
型 |
説明 |
|
enabled
|
boolean
|
アーティファクト ストリーミングは、オンデマンドのイメージ読み込みを通じてノード上のコンテナーのコールド スタートを高速化します。 この機能を使用するには、コンテナー イメージで ACR でのアーティファクト ストリーミングも有効にする必要があります。 指定しない場合、既定値は false です。
|
AgentPoolGatewayProfile
Object
マネージド クラスター ゲートウェイ エージェント プールのプロファイル。
| 名前 |
型 |
規定値 |
説明 |
|
publicIPPrefixSize
|
integer
(int32)
minimum: 28 maximum: 31
|
31
|
ゲートウェイ エージェント プールは、静的エグレス ゲートウェイごとに 1 つのパブリック IPPrefix を関連付けて、パブリック エグレスを提供します。 パブリック IPPrefix のサイズは、ユーザーが選択する必要があります。 エージェント プール内の各ノードには、IPPrefix から 1 つの IP が割り当てられます。 IPPrefix サイズは、ゲートウェイ エージェント プールのサイズの上限として機能します。 Azure パブリック IPPrefix サイズの制限により、有効な値の範囲は [28, 31] です (/31 = 2 ノード/IP、/30 = 4 ノード/IP、/29 = 8 ノード/IP、/28 = 16 ノード/IP)。 既定値は 31 です。
|
AgentPoolMode
列挙
エージェント プールのモード。 クラスターには、常に少なくとも 1 つの "システム" エージェント プールが必要です。 エージェント プールの制限とベスト プラクティスの詳細については、「https://docs.microsoft.com/azure/aks/use-system-pools」を参照してください。
| 値 |
説明 |
|
System
|
システム エージェント プールは、主に CoreDNS や metrics-server などの重要なシステム ポッドをホストするためのものです。 システム エージェント プールの osType は Linux である必要があります。 システム エージェント プール VM SKU には、少なくとも 2vCPU と 4 GB のメモリが必要です。
|
|
User
|
ユーザー エージェント プールは、主にアプリケーション ポッドをホストするためのものです。
|
|
Gateway
|
ゲートウェイ エージェント プールは、ポッドに静的エグレス IP を提供する専用です。 詳細については、 https://aka.ms/aks/static-egress-gatewayを参照してください。
|
AgentPoolNetworkProfile
Object
エージェント プールのネットワーク設定。
| 名前 |
型 |
説明 |
|
allowedHostPorts
|
PortRange[]
|
アクセスが許可されているポート範囲。 指定した範囲は重複できます。
|
|
applicationSecurityGroups
|
string[]
(arm-id)
|
エージェント プールの作成時に関連付けるアプリケーション セキュリティ グループの ID。
|
|
nodePublicIPTags
|
IPTag[]
|
インスタンス レベルのパブリック IP の IP タグ。
|
AgentPoolSecurityProfile
Object
エージェント プールのセキュリティ設定。
| 名前 |
型 |
説明 |
|
enableSecureBoot
|
boolean
|
セキュア ブートは、署名されたオペレーティング システムとドライバーのみが起動できるようにする、トラステッド起動の機能です。 詳細については、aka.ms/aks/trustedlaunch を参照してください。 指定しない場合、既定値は false です。
|
|
enableVTPM
|
boolean
|
vTPM は、ノード上でローカルに保持されているキーと測定用に専用のセキュリティで保護されたコンテナーを構成するための信頼できる起動機能です。 詳細については、aka.ms/aks/trustedlaunch を参照してください。 指定しない場合、既定値は false です。
|
|
sshAccess
|
AgentPoolSSHAccess
|
エージェント プールの SSH アクセス方法。
|
AgentPoolSSHAccess
列挙
エージェント プールの SSH アクセス方法。
| 値 |
説明 |
|
LocalUser
|
秘密鍵を使用して、ローカルユーザーとしてノードにSSH接続できます。
|
|
Disabled
|
ノードでSSHサービスがオフになります。
|
AgentPoolStatus
Object
エージェント プールに関する読み取り専用情報が含まれています。
| 名前 |
型 |
説明 |
|
provisioningError
|
ErrorDetail
|
エージェント プールのエラー詳細情報。 エラーの詳細情報を保持します。 エラーが発生しなかった場合、このフィールドは省略されます。
|
AgentPoolType
列挙
エージェント プールの種類。
| 値 |
説明 |
|
VirtualMachineScaleSets
|
仮想マシン スケール セットによってサポートされるエージェント プールを作成します。
|
|
AvailabilitySet
|
これを使用することは強くお勧めします。
|
|
VirtualMachines
|
単一インスタンス VM オーケストレーション モードでサポートされるエージェント プールを作成します。
|
AgentPoolUpgradeSettings
Object
エージェント プールをアップグレードするための設定
| 名前 |
型 |
説明 |
|
drainTimeoutInMinutes
|
integer
(int32)
minimum: 1 maximum: 1440
|
ノードのドレイン タイムアウト。 ポッドの削除とノードごとのグレースフル終了を待機する時間 (分単位)。 この削除待機時間は、ポッドの中断予算の待機を優先します。 この時間を超えると、アップグレードは失敗します。 指定されていない場合、既定値は 30 分です。
|
|
maxSurge
|
string
|
アップグレード中に急増したノードの最大数または割合。 これは、整数 (例: '5') またはパーセンテージ (例: '50%') に設定できます。 パーセンテージを指定すると、アップグレード時のエージェント・プール・サイズの合計に対するパーセンテージになります。 パーセンテージの場合、小数部のノードは切り上げられます。 指定しない場合、既定値は 10%です。 ベスト プラクティスを含む詳細については、「https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster」を参照してください。
|
|
maxUnavailable
|
string
|
アップグレード中に同時に使用できないノードの最大数または割合。 これは、整数 (例: '1') またはパーセンテージ (例: '5%') に設定できます。 パーセンテージを指定すると、アップグレード時のエージェント・プール・サイズの合計に対するパーセンテージになります。 パーセンテージの場合、小数部のノードは切り上げられます。 指定しない場合、既定値は 0 です。 ベスト プラクティスを含む詳細については、「https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster」を参照してください。
|
|
nodeSoakDurationInMinutes
|
integer
(int32)
minimum: 0 maximum: 30
|
ノードのソーク時間。 ノードをドレインした後、再イメージ化して次のノードに進む前に待機する時間 (分単位)。 指定しない場合、既定値は 0 分です。
|
|
undrainableNodeBehavior
|
UndrainableNodeBehavior
|
アップグレード中の、使用できないノードの動作を定義します。 ノードを使用できない最も一般的な原因はポッド中断予算 (PDB) ですが、ポッドの終了猶予期間が残りのノードごとのドレイン タイムアウトを超えたり、ポッドがまだ実行中の状態であるなど、他の問題が原因で、セッション不可能なノードが発生する可能性もあります。
|
AgentPoolWindowsProfile
Object
Windows エージェント プールの特定のプロファイル。
| 名前 |
型 |
説明 |
|
disableOutboundNat
|
boolean
|
Windows ノードで OutboundNAT を無効にするかどうか。 既定値は false です。 送信 NAT を無効にできるのは、クラスターの outboundType が NAT ゲートウェイであり、Windows エージェント プールでノード パブリック IP が有効になっていない場合のみです。
|
AutoScaleProfile
Object
自動スケーリングの仕様。
| 名前 |
型 |
説明 |
|
maxCount
|
integer
(int32)
|
指定したサイズのノードの最大数。
|
|
minCount
|
integer
(int32)
|
指定したサイズのノードの最小数。
|
|
size
|
string
|
AKS が作成およびスケーリングするときに使用する VM サイズ (例: "Standard_E4s_v3"、"Standard_E16s_v3"、"Standard_D16s_v5")。
|
Code
列挙
クラスターが実行中か停止かを示します
| 値 |
説明 |
|
Running
|
クラスターが実行されています。
|
|
Stopped
|
クラスターが停止しています。
|
createdByType
列挙
リソースを作成した ID の種類。
| 値 |
説明 |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CreationData
Object
ソース リソースからターゲット リソースを作成するときに使用されるデータ。
| 名前 |
型 |
説明 |
|
sourceResourceId
|
string
(arm-id)
|
これは、ターゲット オブジェクトの作成に使用するソース オブジェクトの ARM ID です。
|
ErrorAdditionalInfo
Object
リソース管理エラーの追加情報
| 名前 |
型 |
説明 |
|
info
|
object
|
追加情報。
|
|
type
|
string
|
追加情報の種類。
|
ErrorDetail
Object
エラーの詳細。
| 名前 |
型 |
説明 |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーに関する追加情報。
|
|
code
|
string
|
エラー コード。
|
|
details
|
ErrorDetail[]
|
エラーの詳細。
|
|
message
|
string
|
エラー メッセージ。
|
|
target
|
string
|
エラーの対象。
|
ErrorResponse
Object
エラー応答
GPUDriver
列挙
GPU ドライバーをインストールするかどうか。 指定されていない場合、既定値は Install です。
| 値 |
説明 |
|
Install
|
ドライバーをインストールします。
|
|
None
|
ドライバーのインストールをスキップします。
|
GPUInstanceProfile
列挙
サポートされている GPU VM SKU の GPU MIG インスタンス プロファイルを指定するために使用される GPUInstanceProfile。
| 値 |
説明 |
|
MIG1g
|
MIG 1g GPUインスタンスプロファイル。
|
|
MIG2g
|
MIG 2G GPUインスタンスプロファイル。
|
|
MIG3g
|
MIG 3G GPUインスタンスプロファイル。
|
|
MIG4g
|
MIG 4G GPUインスタンスプロファイル。
|
|
MIG7g
|
MIG 7g GPUインスタンスプロファイル。
|
GPUProfile
Object
エージェント プールの GPU 設定。
| 名前 |
型 |
説明 |
|
driver
|
GPUDriver
|
GPU ドライバーをインストールするかどうか。 指定されていない場合、既定値は Install です。
|
IPTag
Object
オブジェクトに関連付けられている IPTag を格納します。
| 名前 |
型 |
説明 |
|
ipTagType
|
string
|
IP タグの種類。 例: RoutingPreference。
|
|
tag
|
string
|
パブリック IP に関連付けられている IP タグの値。 例: インターネット。
|
KubeletConfig
Object
エージェント ノードの Kubelet 構成。 詳細については、AKS カスタム ノード構成 を参照してください。
| 名前 |
型 |
説明 |
|
allowedUnsafeSysctls
|
string[]
|
安全でない sysctl または安全でない sysctl パターンの許可されたリスト ( *で終わる)。
|
|
containerLogMaxFiles
|
integer
(int32)
minimum: 2
|
コンテナーに表示できるコンテナー ログ ファイルの最大数。 数値は 2 ≥する必要があります。
|
|
containerLogMaxSizeMB
|
integer
(int32)
|
ローテーション前のコンテナー ログ ファイルの最大サイズ (10Mi など)。
|
|
cpuCfsQuota
|
boolean
|
CPU 制限を指定するコンテナーに対して CPU CFS クォータの適用が有効になっている場合。 既定値は true です。
|
|
cpuCfsQuotaPeriod
|
string
|
CPU CFS クォータ期間の値。 既定値は '100 ミリ秒' です。 有効な値は、省略可能な分数と単位サフィックスを持つ 10 進数のシーケンスです。 例: '300ms'、'2h45m'。 サポートされるユニットは、'ns'、'us'、'ms'、's'、'm'、および 'h' です。
|
|
cpuManagerPolicy
|
string
|
使用する CPU マネージャー ポリシー。 既定値は 'none' です。 詳細については、 Kubernetes CPU 管理ポリシーを 参照してください。 使用できる値は 'none' と 'static' です。
|
|
failSwapOn
|
boolean
|
true に設定すると、ノードでスワップが有効になっている場合、Kubelet の起動に失敗します。
|
|
imageGcHighThreshold
|
integer
(int32)
|
イメージ ガベージ コレクションが常に実行されるようになる、ディスク使用量の割合。 イメージ ガベージ コレクションを無効にするには、100 に設定します。 既定値は 85%
|
|
imageGcLowThreshold
|
integer
(int32)
|
イメージ ガベージ コレクションを実行できるようになる、ディスク使用量の割合。 imageGcHighThreshold より高く設定することはできません。 既定値は 80%
|
|
podMaxPids
|
integer
(int32)
|
ポッドあたりのプロセスの最大数。
|
|
topologyManagerPolicy
|
string
|
使用するトポロジ マネージャー ポリシー。 詳細については、「 Kubernetes Topology Manager」を参照してください。 既定値は 'none' です。 使用できる値は、'none'、'best-effort'、'restricted'、および 'single-numa-node' です。
|
KubeletDiskType
列挙
emptyDir ボリューム、コンテナー ランタイム データ ルート、および Kubelet エフェメラル ストレージの配置を決定します。
| 値 |
説明 |
|
OS
|
Kubelet は、データに OS ディスクを使用します。
|
|
Temporary
|
Kubelet は、データに一時ディスクを使用します。
|
LinuxOSConfig
Object
Linux エージェント ノードの OS 構成。 詳細については、AKS カスタム ノード構成 を参照してください。
| 名前 |
型 |
説明 |
|
swapFileSizeMB
|
integer
(int32)
|
各ノードに作成されるスワップ ファイルのサイズ (MB)。
|
|
sysctls
|
SysctlConfig
|
Linux エージェント ノードの Sysctl 設定。
|
|
transparentHugePageDefrag
|
string
|
より多くの巨大なページを使用できるように、カーネルがメモリ圧縮を積極的に使用する必要があるかどうか。 有効な値は、'always'、'defer'、'defer+madvise'、'madvise' および 'never' です。 既定値は 'madvise' です。 詳細については、「Transparent Hugepages」を参照してください。
|
|
transparentHugePageEnabled
|
string
|
透過的な hugepages が有効になっているかどうか。 有効な値は、'always'、'madvise'、および 'never' です。 既定値は "always" です。 詳細については、「Transparent Hugepages」を参照してください。
|
LocalDNSForwardDestination
列挙
localDNS から転送される DNS クエリの宛先サーバー。
| 値 |
説明 |
|
ClusterCoreDNS
|
localDNS からクラスター CoreDNS に DNS クエリを転送します。
|
|
VnetDNS
|
localDNS から VNET で構成された DNS サーバーに DNS クエリを転送します。 VNET には、複数の DNS サーバーを構成できます。
|
LocalDNSForwardPolicy
列挙
アップストリーム DNS サーバーを選択するための転送ポリシー。 詳細については、 フォワードプラグイン を参照してください。
| 値 |
説明 |
|
Sequential
|
アップストリーム DNS サーバーのシーケンシャル選択を実装します。 詳細については、 フォワードプラグイン を参照してください。
|
|
RoundRobin
|
ラウンドロビンアップストリームDNSサーバの選択を実装します。 詳細については、 フォワードプラグイン を参照してください。
|
|
Random
|
ランダムなアップストリーム DNS サーバーの選択を実装します。 詳細については、 フォワードプラグイン を参照してください。
|
LocalDNSMode
列挙
localDNS の有効化モード。
| 値 |
説明 |
|
Preferred
|
現在のオーケストレーター バージョンがこの機能をサポートしている場合は、localDNS を有効にすることをお勧めします。
|
|
Required
|
localDNS を有効にします。
|
|
Disabled
|
localDNS を無効にします。
|
LocalDNSOverride
Object
localDNS プロファイルをオーバーライドします。
LocalDNSProfile
Object
ノードごとのローカル DNS を VnetDNS と KubeDNS のオーバーライドを使用して構成します。 LocalDNS は、AKS クラスターでの DNS 解決のパフォーマンスと信頼性を向上させるのに役立ちます。 詳細については、「aka.ms/aks/localdns」を参照してください。
| 名前 |
型 |
規定値 |
説明 |
|
kubeDNSOverrides
|
<string,
LocalDNSOverride>
|
|
KubeDNSのオーバーライドは、dnsPolicy:ClusterFirstを持つポッドからのDNSトラフィック(KubeDNSトラフィックと呼ばれます)に適用されます。
|
|
mode
|
LocalDNSMode
|
Preferred
|
localDNS の有効化モード。
|
|
state
|
LocalDNSState
|
|
localDNS のシステム生成状態。
|
|
vnetDNSOverrides
|
<string,
LocalDNSOverride>
|
|
VnetDNS オーバーライドは、dnsPolicy:default または kubelet を持つポッドからの DNS トラフィック (VnetDNS トラフィックと呼ばれます) に適用されます。
|
LocalDNSProtocol
列挙
TCPを強制するか、localDNSからアップストリームDNSサーバーへの接続にUDPプロトコルを優先します。
| 値 |
説明 |
|
PreferUDP
|
localDNS からアップストリーム DNS サーバーへの接続には UDP プロトコルを優先します。
|
|
ForceTCP
|
localDNS からアップストリーム DNS サーバーへの接続に TCP プロトコルを適用します。
|
LocalDNSQueryLogging
列挙
localDNS の DNS クエリのログ レベル。
| 値 |
説明 |
|
Error
|
localDNS でのエラーログを有効にします。 詳細については、 errors プラグイン を参照してください。
|
|
Log
|
localDNS でのクエリ ログを有効にします。 詳細については、 log plugin を参照してください。
|
LocalDNSServeStale
列挙
古いデータを提供するためのポリシー。 詳細については、 キャッシュプラグイン を参照してください。
| 値 |
説明 |
|
Verify
|
古いデータを検証で提供します。 まず、期限切れのエントリをクライアントに送信する前に、ソースからエントリがまだ使用できないことを確認します。 詳細については、 キャッシュプラグイン を参照してください。
|
|
Immediate
|
古いデータをすぐに提供します。 期限切れのエントリをクライアントに送信してから、エントリがソースから使用可能かどうかを確認します。 詳細については、 キャッシュプラグイン を参照してください。
|
|
Disable
|
古いデータの提供を無効にします。
|
LocalDNSState
列挙
localDNS のシステム生成状態。
| 値 |
説明 |
|
Enabled
|
localDNS が有効になっている場合。
|
|
Disabled
|
localDNS は無効です。
|
ManualScaleProfile
Object
マシンの数に関する仕様。
| 名前 |
型 |
説明 |
|
count
|
integer
(int32)
|
ノードの数。
|
|
size
|
string
|
AKS が作成およびスケーリングするときに使用する VM サイズ (例: "Standard_E4s_v3"、"Standard_E16s_v3"、"Standard_D16s_v5")。
|
OSDiskType
列挙
エージェント プール内のマシンに使用する OS ディスクの種類。 VM でサポートされていて、要求された OSDiskSizeGB より大きいキャッシュ ディスクがある場合、既定値は "エフェメラル" です。 それ以外の場合、既定値は 'Managed' です。 作成後に変更できない場合があります。 詳細については、「エフェメラル OS を参照してください。
| 値 |
説明 |
|
Managed
|
AZURE は、VM を別のホストに再配置する必要がある場合にデータ損失を回避するために、仮想マシンのオペレーティング システム ディスクを Azure Storage にレプリケートします。 コンテナーはローカル状態を保持するように設計されていないため、この動作では値が制限されますが、ノードのプロビジョニング速度の低下や読み取り/書き込みの待機時間の長さなど、いくつかの欠点があります。
|
|
Ephemeral
|
エフェメラル OS ディスクは、一時ディスクと同様に、ホスト コンピューターにのみ格納されます。 これにより、読み取り/書き込みの待機時間が短くなり、ノードのスケーリングとクラスターのアップグレードが高速化されます。
|
OSSKU
列挙
エージェント プールで使用される OS SKU を指定します。 OSType が Linux の場合、既定値は Ubuntu です。 OSType が Windows の場合、Kubernetes <= 1.24 の場合は Windows 2019、Kubernetes >= 1.25 の場合は Windows2022 が既定値です。
| 値 |
説明 |
|
Ubuntu
|
ノード イメージの OS として Ubuntu を使用します。
|
|
AzureLinux
|
ノード イメージの OS として AzureLinux を使用します。 Azure LinuxはMicrosoftによって開発されたコンテナ最適化のLinuxディストリビューションです。詳細はhttps://aka.ms/azurelinuxをご覧ください。
|
|
AzureLinux3
|
ノード イメージの OS として AzureLinux3 を使用します。 Azure LinuxはMicrosoftによって開発されたコンテナ最適化のLinuxディストリビューションです。詳細はhttps://aka.ms/azurelinuxをご覧ください。 制限事項については、 https://aka.ms/aks/node-images をご覧ください。 OS 移行のガイダンスについては、「 https://aka.ms/aks/upgrade-os-version」を参照してください。
|
|
CBLMariner
|
非推奨の OSSKU。 Microsoftは新規展開では代わりに「AzureLinux」を選ぶことを推奨しています。
|
|
Windows2019
|
ノード イメージの OS として Windows2019 を使用します。 システム ノード プールではサポートされていません。 Windows2019 では、Windows2019 コンテナーのみがサポートされます。Windows 2022 コンテナーを実行することはできません。その逆も同様です。
|
|
Windows2022
|
ノード イメージの OS として Windows2022 を使用します。 システム ノード プールではサポートされていません。 Windows2022 では、Windows2022 コンテナーのみがサポートされます。Windows 2019 コンテナーを実行することはできません。その逆も同様です。
|
|
Ubuntu2204
|
ノードイメージのOSとしてUbuntu2204を使用しますが、Ubuntu 22.04がすべてのノードプールでサポートされているとは限りません。 制限事項とサポートされている Kubernetes のバージョンについては、 https://aka.ms/aks/supported-ubuntu-versions
|
|
Windows2025
|
ノードイメージのOSはWindows2025を使用します。 システム ノード プールではサポートされていません。 Windows2025はWindows2022およびWindows 2025コンテナをサポートしていますが、Windows2019コンテナは実行できず、その逆もできません。
|
|
Ubuntu2404
|
ノードイメージのOSとしてUbuntu2404を使用しますが、Ubuntu 24.04がすべてのノードプールでサポートされているとは限りません。 制限事項とサポートされている kubernetes バージョンについては、以下を参照してください。 https://aka.ms/aks/supported-ubuntu-versions
|
|
AzureContainerLinux
|
NodeイメージのOSとしてAzure Container Linuxを使いましょう。 Azure Container Linuxは、Azure Linux上で構築されたコンテナ最適化され、セキュリティ重視のLinuxオペレーティングシステムで、不変ファイルシステムを備えています。 ACLはFlatcar Container Linuxプロジェクトから派生し、Flatcarの実証済みのコンテナ優先で不変の設計を基盤に、Azure Linuxパッケージ、サービス、AzureおよびAKSライフサイクルとの深い統合を追加しています。 詳細については、https://aka.ms/azurecontainerlinux を参照してください。
|
OSType
列挙
オペレーティング システムの種類。 既定値は Linux です。
| 値 |
説明 |
|
Linux
|
Linux を使用します。
|
|
Windows
|
Windows を使用します。
|
PodIPAllocationMode
列挙
ポッド IP 割り当てモード。 エージェント プール内のポッドの IP 割り当てモード。 podSubnetId と共に使用する必要があります。 既定値は "DynamicIndividual" です。
| 値 |
説明 |
|
DynamicIndividual
|
各ノードには、ポッドに割り当てることができる IP アドレスの非連続リストが割り当てられます。 これは、サイズ /16 以下の小規模から中規模のサブネットを最大化する場合に適しています。 動的 IP 割り当てがある Azure CNI クラスターは、お客様が podIPAllocationMode を明示的に指定しない場合、既定でこのモードになります。
|
|
StaticBlock
|
各ノードには、ノードあたりの maxPods を満たすために、サイズ /28 = ブロックあたり 16 IP の CIDR ブロックが静的に割り当てられます。
>の CIDR ブロックの数 = (maxPods / 16)。 ブロックは単一のIPではなく、Azure VnetのプライベートIP制限65Kにカウントされます。 そのため、ブロック モードは、クラスター内の現在の制限である 65K ポッドを超える大規模なワークロードを実行するのに適しています。 このモードは、/15 以上の大きなサブネットでスケーリングする場合に適しています
|
PortRange
Object
ポート範囲。
| 名前 |
型 |
説明 |
|
portEnd
|
integer
(int32)
minimum: 1 maximum: 65535
|
範囲に含まれる最大ポート。 範囲は 1 から 65535 で、portStart 以上である必要があります。
|
|
portStart
|
integer
(int32)
minimum: 1 maximum: 65535
|
範囲に含まれる最小ポート。 範囲は 1 から 65535 で、portEnd 以下である必要があります。
|
|
protocol
|
Protocol
|
ポートのネットワーク プロトコル。
|
PowerState
Object
クラスターの電源状態について説明します
| 名前 |
型 |
説明 |
|
code
|
Code
|
クラスターが実行中か停止かを示します
|
Protocol
列挙
ポートのネットワーク プロトコル。
| 値 |
説明 |
|
TCP
|
TCP プロトコル。
|
|
UDP
|
UDP プロトコル。
|
ScaleDownMode
列挙
VM をエージェント プールに追加またはエージェント プールから削除する方法について説明します。 「 課金状態」を参照してください。
| 値 |
説明 |
|
Delete
|
スケールアップ中に新しいインスタンスを作成し、スケールダウン中にインスタンスを削除します。
|
|
Deallocate
|
スケールアップ中に割り当て解除されたインスタンス (存在する場合) を開始し、スケール ダウン中にインスタンスの割り当てを解除します。
|
ScaleProfile
Object
VirtualMachines エージェント プールのスケーリング方法に関する仕様。
| 名前 |
型 |
説明 |
|
autoscale
|
AutoScaleProfile[]
|
定義済みのサイズ範囲内で VirtualMachines エージェント プールを自動スケールする方法に関する仕様。
各プロファイルは特定のVM SKUを対象とし、独立して評価されます。
プロファイル間のスケーリング決定は、 ManagedCluster.properties.autoScalerProfile.expanderで設定可能なクラスターオートスケーラーエクスパンダーによって制御されます。
|
|
manual
|
ManualScaleProfile[]
|
VirtualMachines エージェント プールを固定サイズにスケーリングする方法に関する仕様。
|
ScaleSetEvictionPolicy
列挙
仮想マシン スケール セットの削除ポリシー。 削除ポリシーは、VMが削除されたときにVMをどうするかを指定します。 デフォルトは [削除] です。 削除の詳細については、「スポット VM」を参照してください
| 値 |
説明 |
|
Delete
|
ノード プールの基になるスケール セット内のノードは、削除されると削除されます。
|
|
Deallocate
|
ノード プールの基になるスケール セット内のノードは、削除時に停止された割り当て解除状態に設定されます。 停止して割り当て解除された状態のノードは、コンピューティング クォータに対してカウントされ、クラスターのスケーリングまたはアップグレードに問題が発生する可能性があります。
|
ScaleSetPriority
列挙
仮想マシン スケール セットの優先順位。
| 値 |
説明 |
|
Spot
|
スポット優先度 VM が使用されます。 スポット ノードの SLA はありません。 詳細については、AKS の スポットを参照してください。
|
|
Regular
|
通常の VM が使用されます。
|
SysctlConfig
Object
Linux エージェント ノードの Sysctl 設定。
| 名前 |
型 |
説明 |
|
fsAioMaxNr
|
integer
(int32)
|
sysctl setting fs.aio-max-nr.
|
|
fsFileMax
|
integer
(int32)
|
sysctl 設定 fs.file-max.
|
|
fsInotifyMaxUserWatches
|
integer
(int32)
|
sysctl setting fs.inotify.max_user_watches.
|
|
fsNrOpen
|
integer
(int32)
|
Sysctl 設定fs.nr_open。
|
|
kernelThreadsMax
|
integer
(int32)
|
sysctl setting kernel.threads-max.
|
|
netCoreNetdevMaxBacklog
|
integer
(int32)
|
Sysctl 設定net.core.netdev_max_backlog。
|
|
netCoreOptmemMax
|
integer
(int32)
|
Sysctl 設定net.core.optmem_max。
|
|
netCoreRmemDefault
|
integer
(int32)
|
Sysctl 設定net.core.rmem_default。
|
|
netCoreRmemMax
|
integer
(int32)
|
Sysctl 設定net.core.rmem_max。
|
|
netCoreSomaxconn
|
integer
(int32)
|
sysctl setting net.core.somaxconn.
|
|
netCoreWmemDefault
|
integer
(int32)
|
Sysctl 設定net.core.wmem_default。
|
|
netCoreWmemMax
|
integer
(int32)
|
Sysctl 設定net.core.wmem_max。
|
|
netIpv4IpLocalPortRange
|
string
|
Sysctl 設定net.ipv4.ip_local_port_range。
|
|
netIpv4NeighDefaultGcThresh1
|
integer
(int32)
|
Sysctl 設定net.ipv4.neigh.default.gc_thresh1。
|
|
netIpv4NeighDefaultGcThresh2
|
integer
(int32)
|
Sysctl 設定net.ipv4.neigh.default.gc_thresh2。
|
|
netIpv4NeighDefaultGcThresh3
|
integer
(int32)
|
Sysctl 設定net.ipv4.neigh.default.gc_thresh3。
|
|
netIpv4TcpFinTimeout
|
integer
(int32)
|
Sysctl 設定net.ipv4.tcp_fin_timeout。
|
|
netIpv4TcpKeepaliveProbes
|
integer
(int32)
|
Sysctl 設定net.ipv4.tcp_keepalive_probes。
|
|
netIpv4TcpKeepaliveTime
|
integer
(int32)
|
Sysctl 設定net.ipv4.tcp_keepalive_time。
|
|
netIpv4TcpMaxSynBacklog
|
integer
(int32)
|
Sysctl 設定net.ipv4.tcp_max_syn_backlog。
|
|
netIpv4TcpMaxTwBuckets
|
integer
(int32)
|
Sysctl 設定net.ipv4.tcp_max_tw_buckets。
|
|
netIpv4TcpTwReuse
|
boolean
|
Sysctl 設定net.ipv4.tcp_tw_reuse。
|
|
netIpv4TcpkeepaliveIntvl
|
integer
(int32)
minimum: 10 maximum: 90
|
Sysctl 設定net.ipv4.tcp_keepalive_intvl。
|
|
netNetfilterNfConntrackBuckets
|
integer
(int32)
minimum: 65536 maximum: 524288
|
Sysctl 設定net.netfilter.nf_conntrack_buckets。
|
|
netNetfilterNfConntrackMax
|
integer
(int32)
minimum: 131072 maximum: 2097152
|
Sysctl 設定net.netfilter.nf_conntrack_max。
|
|
vmMaxMapCount
|
integer
(int32)
|
sysctl setting vm.max_map_count.
|
|
vmSwappiness
|
integer
(int32)
|
sysctl setting vm.swappiness.
|
|
vmVfsCachePressure
|
integer
(int32)
|
Sysctl 設定vm.vfs_cache_pressure。
|
systemData
Object
リソースの作成と最後の変更に関連するメタデータ。
| 名前 |
型 |
説明 |
|
createdAt
|
string
(date-time)
|
リソース作成のタイムスタンプ (UTC)。
|
|
createdBy
|
string
|
リソースを作成した ID。
|
|
createdByType
|
createdByType
|
リソースを作成した ID の種類。
|
|
lastModifiedAt
|
string
(date-time)
|
リソースの最終変更のタイムスタンプ (UTC)
|
|
lastModifiedBy
|
string
|
リソースを最後に変更した ID。
|
|
lastModifiedByType
|
createdByType
|
リソースを最後に変更した ID の種類。
|
UndrainableNodeBehavior
列挙
アップグレード中の、使用できないノードの動作を定義します。 ノードを使用できない最も一般的な原因はポッド中断予算 (PDB) ですが、ポッドの終了猶予期間が残りのノードごとのドレイン タイムアウトを超えたり、ポッドがまだ実行中の状態であるなど、他の問題が原因で、セッション不可能なノードが発生する可能性もあります。
| 値 |
説明 |
|
Cordon
|
AKS は、ブロックされたノードを切断し、アップグレード中にサージ ノードに置き換えます。 ブロックされたノードは切断され、サージ ノードに置き換えられます。 ブロックされたノードには、"kubernetes.azure.com/upgrade-status:Quarantined" というラベルが付けられます。 サージ ノードは、ブロックされたノードごとに保持されます。 他のすべてのサージ ノードを削除するためのベスト エフォート試行が行われます。 ブロックされたノードを置き換えるのに十分なサージ ノードがある場合、アップグレード操作とマネージド クラスターは失敗状態になります。 それ以外の場合、アップグレード操作とマネージド クラスターは取り消された状態になります。
|
|
Schedule
|
AKS はブロックされたノードをスケジュール可能としてマークしますが、ブロックされたノードはアップグレードされません。 すべてのサージ ノードを削除するためのベスト エフォート試行が行われます。 ブロックされたノードがある場合、アップグレード操作とマネージド クラスターは失敗状態になります。
|
VirtualMachineNodes
Object
同じ VM サイズのノード グループの現在の状態。
| 名前 |
型 |
説明 |
|
count
|
integer
(int32)
|
ノードの数。
|
|
size
|
string
|
このノード グループをホストするために使用されるエージェントの VM サイズ。
|
VirtualMachinesProfile
Object
VirtualMachines エージェント プールの仕様。
| 名前 |
型 |
説明 |
|
scale
|
ScaleProfile
|
VirtualMachines エージェント プールのスケーリング方法に関する仕様。
|
WorkloadRuntime
列挙
ノードが実行できるワークロードの種類を決定します。
| 値 |
説明 |
|
OCIContainer
|
ノードは Kubelet を使用して、標準の OCI コンテナー ワークロードを実行します。
|
|
WasmWasi
|
ノードは、WASI プロバイダー (プレビュー) を使用して WASM ワークロードを実行するために、クルースレットを使用します。
|
|
KataVmIsolation
|
ノードは (Kata + Cloud Hypervisor + Hyper-V) を使用して、ネストされた VM ベースのポッドを有効にすることができます。 Hyper-Vの使用により、AKSノードOS自体はHyper-VのネストされたVM(ルートOS)となっています。 したがって、Dv3 シリーズなどの入れ子になった仮想化をサポートする VM シリーズでのみ使用できます。
|