Tworzy lub aktualizuje pulę agentów w określonym klastrze zarządzanym.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}?api-version=2025-10-01
Parametry URI
| Nazwa |
W |
Wymagane |
Typ |
Opis |
|
agentPoolName
|
path |
True
|
string
minLength: 1 maxLength: 12 pattern: ^[a-z][a-z0-9]{0,11}$
|
Nazwa puli agentów.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter.
|
|
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]$
|
Nazwa zasobu klastra zarządzanego.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Wersja interfejsu API do użycia dla tej operacji.
|
| Nazwa |
Wymagane |
Typ |
Opis |
|
If-Match
|
|
string
|
Żądanie powinno być kontynuowane tylko wtedy, gdy jednostka pasuje do tego ciągu.
|
|
If-None-Match
|
|
string
|
Żądanie powinno być kontynuowane tylko wtedy, gdy żadna jednostka nie pasuje do tego ciągu.
|
Ciało żądania
| Nazwa |
Typ |
Opis |
|
properties.availabilityZones
|
string[]
|
Lista stref dostępności do użycia dla węzłów. Można to określić tylko wtedy, gdy właściwość AgentPoolType to "VirtualMachineScaleSets".
|
|
properties.capacityReservationGroupID
|
string
(arm-id)
|
Usługa AKS skojarzy określoną pulę agentów z grupą rezerwacji pojemności.
|
|
properties.count
|
integer
(int32)
|
Liczba agentów (maszyn wirtualnych) do hostowania kontenerów platformy Docker. Dozwolone wartości muszą należeć do zakresu od 0 do 1000 (włącznie) dla pul użytkowników i w zakresie od 1 do 1000 (włącznie) dla pul systemowych. Wartość domyślna to 1.
|
|
properties.creationData
|
CreationData
|
CreationData do określenia źródłowego identyfikatora migawki, jeśli pula węzłów zostanie utworzona/uaktualniona przy użyciu migawki.
|
|
properties.enableAutoScaling
|
boolean
|
Czy włączyć automatyczne skalowanie
|
|
properties.enableEncryptionAtHost
|
boolean
|
Czy włączyć szyfrowanie dysków danych i systemu operacyjnego opartego na hoście. Jest to obsługiwane tylko w przypadku niektórych rozmiarów maszyn wirtualnych i w niektórych regionach świadczenia usługi Azure. Aby uzyskać więcej informacji, zobacz: https://docs.microsoft.com/azure/aks/enable-host-encryption
|
|
properties.enableFIPS
|
boolean
|
Czy używać systemu operacyjnego z obsługą protokołu FIPS. Aby uzyskać więcej informacji, zobacz Dodawanie puli węzłów z obsługą protokołu FIPS.
|
|
properties.enableNodePublicIP
|
boolean
|
Określa, czy każdy węzeł jest przydzielany do własnego publicznego adresu IP. Niektóre scenariusze mogą wymagać, aby węzły w puli węzłów odbierały własne dedykowane publiczne adresy IP. Typowy scenariusz dotyczy obciążeń gier, w których konsola musi nawiązać bezpośrednie połączenie z maszyną wirtualną w chmurze, aby zminimalizować przeskoki. Aby uzyskać więcej informacji, zobacz przypisywanie publicznego adresu IP na węzeł. Wartość domyślna to false.
|
|
properties.enableUltraSSD
|
boolean
|
Czy włączyć warstwę UltraSSD
|
|
properties.gatewayProfile
|
AgentPoolGatewayProfile
|
Profil specyficzny dla zarządzanej puli agentów w trybie bramy. Nie można ustawić tego pola, jeśli tryb puli agentów nie jest bramą.
|
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
GpuInstanceProfile do użycia w celu określenia profilu wystąpienia migracji procesora GPU dla obsługiwanej jednostki SKU maszyny wirtualnej procesora GPU.
|
|
properties.gpuProfile
|
GPUProfile
|
Ustawienia procesora GPU dla puli agentów.
|
|
properties.hostGroupID
|
string
(arm-id)
|
W pełni kwalifikowany identyfikator zasobu dedykowanej grupy hostów do aprowizowania maszyn wirtualnych używany tylko w scenariuszu tworzenia i nie może zmienić się po ustawieniu. Jest to formularz: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. Aby uzyskać więcej informacji, zobacz dedykowanych hostów platformy Azure.
|
|
properties.kubeletConfig
|
KubeletConfig
|
Konfiguracja rozwiązania Kubelet w węzłach puli agentów.
|
|
properties.kubeletDiskType
|
KubeletDiskType
|
Określa umieszczanie woluminów emptyDir, katalogu głównego danych środowiska uruchomieniowego kontenera i magazynu efemerycznego Kubelet.
|
|
properties.linuxOSConfig
|
LinuxOSConfig
|
Konfiguracja systemu operacyjnego węzłów agenta systemu Linux.
|
|
properties.localDNSProfile
|
LocalDNSProfile
|
Konfiguruje lokalny system DNS dla poszczególnych węzłów z przesłonięciami VnetDNS i KubeDNS. LocalDNS pomaga zwiększyć wydajność i niezawodność rozpoznawania nazw DNS w klastrze usługi AKS. Aby uzyskać więcej informacji, zobacz aka.ms/aks/localdns.
|
|
properties.maxCount
|
integer
(int32)
|
Maksymalna liczba węzłów do automatycznego skalowania
|
|
properties.maxPods
|
integer
(int32)
|
Maksymalna liczba zasobników, które mogą być uruchamiane w węźle.
|
|
properties.messageOfTheDay
|
string
|
Komunikat dnia dla węzłów systemu Linux zakodowany w formacie base64. Ciąg zakodowany w formacie base64, który zostanie zapisany w pliku /etc/motd po dekodowaniu. Umożliwia to dostosowanie komunikatu dnia dla węzłów systemu Linux. Nie można go określić dla węzłów systemu Windows. Musi to być ciąg statyczny (tj. zostanie wydrukowany jako nieprzetworzone i nie zostanie wykonany jako skrypt).
|
|
properties.minCount
|
integer
(int32)
|
Minimalna liczba węzłów do automatycznego skalowania
|
|
properties.mode
|
AgentPoolMode
|
Tryb puli agentów. Klaster musi mieć co najmniej jedną pulę agentów "System" przez cały czas. Aby uzyskać dodatkowe informacje na temat ograniczeń puli agentów i najlepszych rozwiązań, zobacz: https://docs.microsoft.com/azure/aks/use-system-pools
|
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
Ustawienia związane z siecią puli agentów.
|
|
properties.nodeLabels
|
object
|
Etykiety węzłów, które mają być utrwalane we wszystkich węzłach w puli agentów.
|
|
properties.nodePublicIPPrefixID
|
string
(arm-id)
|
Identyfikator prefiksu publicznego adresu IP, z którego węzły maszyny wirtualnej powinny używać adresów IP. Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}
|
|
properties.nodeTaints
|
string[]
|
Defekty dodane do nowych węzłów podczas tworzenia i skalowania puli węzłów. Na przykład key=value:NoSchedule.
|
|
properties.orchestratorVersion
|
string
|
Wersja platformy Kubernetes określona przez użytkownika. Obsługiwane są obie wersje poprawek <major.minor.patch> (np. 1.20.13) i <major.minor> (np. 1.20). Po określeniu <główna.pomocnicza> jest wybierana automatycznie najnowsza obsługiwana wersja poprawki ogólnie dostępnej. Aktualizowanie klastra przy użyciu tego samego <major.minor> po jego utworzeniu (np. 1.14.x —> 1.14) nie wyzwoli uaktualnienia, nawet jeśli jest dostępna nowsza wersja poprawki. Najlepszym rozwiązaniem jest uaktualnienie wszystkich pul węzłów w klastrze usługi AKS do tej samej wersji rozwiązania Kubernetes. Wersja puli węzłów musi mieć taką samą wersję główną jak płaszczyzna sterowania. Wersja pomocnicza puli węzłów musi należeć do dwóch wersji pomocniczych wersji płaszczyzny sterowania. Wersja puli węzłów nie może być większa niż wersja płaszczyzny sterowania. Aby uzyskać więcej informacji, zobacz uaktualnianie puli węzłów.
|
|
properties.osDiskSizeGB
|
integer
(int32)
minimum: 0 maximum: 2048
|
Rozmiar dysku systemu operacyjnego w GB do określenia rozmiaru dysku dla każdej maszyny w puli głównej/agenta. Jeśli określisz wartość 0, zostanie zastosowana domyślna wartość osDisk size zgodnie z określoną wartością vmSize.
|
|
properties.osDiskType
|
OSDiskType
|
Typ dysku systemu operacyjnego, który ma być używany dla maszyn w puli agentów. Wartość domyślna to "Efemeryczna", jeśli maszyna wirtualna ją obsługuje i ma dysk pamięci podręcznej większy niż żądany dysk OSDiskSizeGB. W przeciwnym razie wartość domyślna to "Zarządzane". Nie można zmienić po utworzeniu. Aby uzyskać więcej informacji, zobacz efemeryczny system operacyjny.
|
|
properties.osSKU
|
OSSKU
|
Określa jednostkę SKU systemu operacyjnego używaną przez pulę agentów. Wartość domyślna to Ubuntu, jeśli typ systemu operacyjnego to Linux. Wartość domyślna to Windows2019, gdy platforma Kubernetes <= 1.24 lub Windows2022, gdy platforma Kubernetes >= 1,25, jeśli typ systemu operacyjnego to Windows.
|
|
properties.osType
|
OSType
|
Typ systemu operacyjnego. Wartość domyślna to Linux.
|
|
properties.podIPAllocationMode
|
PodIPAllocationMode
|
Tryb alokacji adresów IP zasobnika. Tryb alokacji adresów IP dla zasobników w puli agentów. Musi być używany z podSubnetId. Wartość domyślna to "DynamicIndividual".
|
|
properties.podSubnetID
|
string
(arm-id)
|
Identyfikator podsieci, która zasobniki zostaną przyłączone po uruchomieniu. W przypadku pominięcia adresy IP zasobników są statycznie przypisywane w podsieci węzła (zobacz vnetSubnetID, aby uzyskać więcej informacji). Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
|
properties.powerState
|
PowerState
|
Niezależnie od tego, czy pula agentów jest uruchomiona, czy zatrzymana. Po pierwszym utworzeniu puli agentów jest ona początkowo uruchomiona. Pulę agentów można zatrzymać, ustawiając to pole na Zatrzymano. Zatrzymana pula agentów zatrzymuje wszystkie maszyny wirtualne i nie nalicza opłat za rozliczenia. Pulę agentów można zatrzymać tylko wtedy, gdy jest uruchomiona, a stan aprowizacji to Powodzenie
|
|
properties.proximityPlacementGroupID
|
string
(arm-id)
|
Identyfikator grupy umieszczania w pobliżu.
|
|
properties.scaleDownMode
|
ScaleDownMode
|
Tryb skalowania w dół używany podczas skalowania puli agentów. Ma to również wpływ na zachowanie narzędzia do automatycznego skalowania klastra. Jeśli nie zostanie określony, domyślnie ma wartość Usuń.
|
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Zasady eksmisji zestawu skalowania maszyn wirtualnych do użycia. Nie można tego określić, chyba że element scaleSetPriority ma wartość "Spot". Jeśli nie zostanie określony, wartość domyślna to "Usuń".
|
|
properties.scaleSetPriority
|
ScaleSetPriority
|
Priorytet zestawu skalowania maszyn wirtualnych. Jeśli nie zostanie określony, wartość domyślna to "Regular".
|
|
properties.securityProfile
|
AgentPoolSecurityProfile
|
Ustawienia zabezpieczeń puli agentów.
|
|
properties.spotMaxPrice
|
number
|
Maksymalna cena (w dolarach amerykańskich) jest gotowa zapłacić za wystąpienia typu spot. Możliwe wartości to dowolna wartość dziesiętna większa niż zero lub -1, która wskazuje, że domyślna cena ma być up-to na żądanie. Możliwe wartości to dowolna wartość dziesiętna większa niż zero lub -1, która wskazuje gotowość do zapłaty dowolnej ceny na żądanie. Aby uzyskać więcej informacji na temat cennika typu spot, zobacz cennik maszyn wirtualnych typu spot
|
|
properties.status
|
AgentPoolStatus
|
Zawiera informacje tylko do odczytu dotyczące puli agentów.
|
|
properties.tags
|
object
|
Tagi, które mają być utrwalane w zestawie skalowania maszyn wirtualnych puli agentów.
|
|
properties.type
|
AgentPoolType
|
Typ puli agentów.
|
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
Ustawienia uaktualniania puli agentów
|
|
properties.virtualMachineNodesStatus
|
VirtualMachineNodes[]
|
Stan węzłów w puli agentów VirtualMachines.
|
|
properties.virtualMachinesProfile
|
VirtualMachinesProfile
|
Specyfikacje w puli agentów VirtualMachines.
|
|
properties.vmSize
|
string
|
Rozmiar maszyn wirtualnych puli agentów. Dostępność rozmiaru maszyny wirtualnej różni się w zależności od regionu. Jeśli węzeł zawiera niewystarczające zasoby obliczeniowe (pamięć, procesor itp.), zasobniki mogą nie działać poprawnie. Aby uzyskać więcej informacji na temat ograniczonych rozmiarów maszyn wirtualnych, zobacz: https://docs.microsoft.com/azure/aks/quotas-skus-regions
|
|
properties.vnetSubnetID
|
string
(arm-id)
|
Identyfikator podsieci, która węzły puli agentów i opcjonalnie zasobniki zostaną przyłączone podczas uruchamiania. Jeśli ta wartość nie zostanie określona, zostanie wygenerowana i użyta sieć wirtualna oraz podsieć. Jeśli nie określono parametru podSubnetID, dotyczy to węzłów i zasobników, w przeciwnym razie dotyczy tylko węzłów. Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
Określony profil puli agentów systemu Windows.
|
|
properties.workloadRuntime
|
WorkloadRuntime
|
Określa typ obciążenia, który może uruchomić węzeł.
|
Odpowiedzi
| Nazwa |
Typ |
Opis |
|
200 OK
|
AgentPool
|
Istniejąca pula agentów została pomyślnie zaktualizowana.
|
|
201 Created
|
AgentPool
|
Nowa pula agentów została pomyślnie utworzona.
|
|
Other Status Codes
|
ErrorResponse
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ protokołu OAuth2 usługi Azure Active Directory
Typ:
oauth2
Flow:
implicit
URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresów
| Nazwa |
Opis |
|
user_impersonation
|
Podszywać się pod Twoje konto użytkownika
|
Przykłady
Create Agent Pool using an agent pool snapshot
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Snapshot.json
*/
async function createAgentPoolUsingAnAgentPoolSnapshot() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Snapshot.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
EnableFips = true,
CreationDataSourceResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
Create Agent Pool with Capacity Reservation Group
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_CRG.json
*/
async function createAgentPoolWithCapacityReservationGroup() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
capacityReservationGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
count: 3,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_CRG.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
CapacityReservationGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
Create Agent Pool with Dedicated Host Group
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
*/
async function createAgentPoolWithDedicatedHostGroup() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
hostGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
HostGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
Create Agent Pool with EncryptionAtHost enabled
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
*/
async function createAgentPoolWithEncryptionAtHostEnabled() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableEncryptionAtHost: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
EnableEncryptionAtHost = true,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
Create Agent Pool with Ephemeral OS Disk
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osDiskType": "Ephemeral",
"osDiskSizeGB": 64
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Ephemeral.json
*/
async function createAgentPoolWithEphemeralOSDisk() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
orchestratorVersion: "",
osDiskSizeGB: 64,
osDiskType: "Ephemeral",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Ephemeral.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSDiskSizeInGB = 64,
OSDiskType = ContainerServiceOSDiskType.Ephemeral,
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskType": "Ephemeral",
"osDiskSizeGB": 64
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskType": "Ephemeral",
"kubeletDiskType": "OS",
"osDiskSizeGB": 64
}
}
Create Agent Pool with FIPS enabled OS
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableFIPS": true
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableFIPS.json
*/
async function createAgentPoolWithFipsEnabledOS() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableFips: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableFIPS.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
EnableFips = true,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true
}
}
Create Agent Pool with GPUMIG
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_GPUMIG.json
*/
async function createAgentPoolWithGpumig() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_GPUMIG.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_ND96asr_v4",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
KubeletConfig = new KubeletConfig
{
CpuManagerPolicy = "static",
IsCpuCfsQuotaEnabled = true,
CpuCfsQuotaPeriod = "200ms",
ImageGcHighThreshold = 90,
ImageGcLowThreshold = 70,
TopologyManagerPolicy = "best-effort",
AllowedUnsafeSysctls = { "kernel.msg*", "net.core.somaxconn" },
FailStartWithSwapOn = false,
},
LinuxOSConfig = new LinuxOSConfig
{
Sysctls = new SysctlConfig
{
NetCoreWmemDefault = 12345,
NetIPv4TcpTwReuse = true,
NetIPv4IPLocalPortRange = "20000 60000",
KernelThreadsMax = 99999,
},
TransparentHugePageEnabled = "always",
TransparentHugePageDefrag = "madvise",
SwapFileSizeInMB = 1500,
},
GpuInstanceProfile = GpuInstanceProfile.Mig2G,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"maxPods": 110,
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"maxPods": 110,
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with Krustlet and the WASI runtime
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WasmWasi.json
*/
async function createAgentPoolWithKrustletAndTheWasiRuntime() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
mode: "User",
orchestratorVersion: "",
osDiskSizeGB: 64,
osType: "Linux",
vmSize: "Standard_DS2_v2",
workloadRuntime: "WasmWasi",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WasmWasi.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSDiskSizeInGB = 64,
WorkloadRuntime = WorkloadRuntime.WasmWasi,
OSType = ContainerServiceOSType.Linux,
Mode = AgentPoolMode.User,
OrchestratorVersion = "",
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
Create Agent Pool with KubeletConfig and LinuxOSConfig
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json
*/
async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
KubeletConfig = new KubeletConfig
{
CpuManagerPolicy = "static",
IsCpuCfsQuotaEnabled = true,
CpuCfsQuotaPeriod = "200ms",
ImageGcHighThreshold = 90,
ImageGcLowThreshold = 70,
TopologyManagerPolicy = "best-effort",
AllowedUnsafeSysctls = { "kernel.msg*", "net.core.somaxconn" },
FailStartWithSwapOn = false,
},
LinuxOSConfig = new LinuxOSConfig
{
Sysctls = new SysctlConfig
{
NetCoreWmemDefault = 12345,
NetIPv4TcpTwReuse = true,
NetIPv4IPLocalPortRange = "20000 60000",
KernelThreadsMax = 99999,
},
TransparentHugePageEnabled = "always",
TransparentHugePageDefrag = "madvise",
SwapFileSizeInMB = 1500,
},
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with Message of the Day
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"messageOfTheDay": "Zm9vCg=="
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_MessageOfTheDay.json
*/
async function createAgentPoolWithMessageOfTheDay() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
messageOfTheDay: "Zm9vCg==",
mode: "User",
orchestratorVersion: "",
osDiskSizeGB: 64,
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_MessageOfTheDay.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSDiskSizeInGB = 64,
MessageOfTheDay = "Zm9vCg==",
OSType = ContainerServiceOSType.Linux,
Mode = AgentPoolMode.User,
OrchestratorVersion = "",
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"messageOfTheDay": "Zm9vCg=="
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"messageOfTheDay": "Zm9vCg=="
}
}
Create Agent Pool with OSSKU
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_OSSKU.json
*/
async function createAgentPoolWithOssku() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_OSSKU.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OSSku = ContainerServiceOSSku.AzureLinux,
OrchestratorVersion = "",
KubeletConfig = new KubeletConfig
{
CpuManagerPolicy = "static",
IsCpuCfsQuotaEnabled = true,
CpuCfsQuotaPeriod = "200ms",
ImageGcHighThreshold = 90,
ImageGcLowThreshold = 70,
TopologyManagerPolicy = "best-effort",
AllowedUnsafeSysctls = { "kernel.msg*", "net.core.somaxconn" },
FailStartWithSwapOn = false,
},
LinuxOSConfig = new LinuxOSConfig
{
Sysctls = new SysctlConfig
{
NetCoreWmemDefault = 12345,
NetIPv4TcpTwReuse = true,
NetIPv4IPLocalPortRange = "20000 60000",
KernelThreadsMax = 99999,
},
TransparentHugePageEnabled = "always",
TransparentHugePageDefrag = "madvise",
SwapFileSizeInMB = 1500,
},
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with PPG
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_PPG.json
*/
async function createAgentPoolWithPpg() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
orchestratorVersion: "",
osType: "Linux",
proximityPlacementGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_PPG.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
ProximityPlacementGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
Create Agent Pool with UltraSSD enabled
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableUltraSSD": true
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json
*/
async function createAgentPoolWithUltraSsdEnabled() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableUltraSSD: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS2_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
EnableUltraSsd = true,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableUltraSSD": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableUltraSSD": true
}
}
Create Agent Pool with VirtualMachines pool type
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"type": "VirtualMachines",
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"size": "Standard_D2_v2",
"count": 3
},
{
"size": "Standard_D2_v3",
"count": 2
}
]
}
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
}},
},
},
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_TypeVirtualMachines.json
*/
async function createAgentPoolWithVirtualMachinesPoolType() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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" },
],
},
},
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_TypeVirtualMachines.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
OSType = ContainerServiceOSType.Linux,
TypePropertiesType = AgentPoolType.VirtualMachines,
OrchestratorVersion = "1.9.6",
Tags =
{
["name1"] = "val1"
},
NodeLabels =
{
["key1"] = "val1"
},
NodeTaints = { "Key1=Value1:NoSchedule" },
ScaleManual = {new ManualScaleProfile
{
Size = "Standard_D2_v2",
Count = 3,
}, new ManualScaleProfile
{
Size = "Standard_D2_v3",
Count = 2,
}},
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"type": "VirtualMachines",
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"size": "Standard_D2_v2",
"count": 3
},
{
"size": "Standard_D2_v3",
"count": 2
}
]
}
},
"virtualMachineNodesStatus": [
{
"size": "Standard_D2_v2",
"count": 3
},
{
"size": "Standard_D2_v3",
"count": 2
}
],
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"type": "VirtualMachines",
"virtualMachinesProfile": {
"scale": {
"manual": [
{
"size": "Standard_D2_v2",
"count": 3
},
{
"size": "Standard_D2_v3",
"count": 2
}
]
}
},
"virtualMachineNodesStatus": [
{
"size": "Standard_D2_v2",
"count": 3
},
{
"size": "Standard_D2_v3",
"count": 2
}
],
"nodeImageVersion": "AKSUbuntu-1804gen2containerd-2021.09.11"
}
}
Create Agent Pool with Windows OSSKU
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"osType": "Windows",
"osSKU": "Windows2022"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json
*/
async function createAgentPoolWithWindowsOssku() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "wnp2";
const parameters = {
count: 3,
orchestratorVersion: "1.23.3",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "wnp2";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_D4s_v3",
OSType = ContainerServiceOSType.Windows,
OSSku = ContainerServiceOSSku.Windows2022,
OrchestratorVersion = "1.23.3",
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.23.3",
"currentOrchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.23.3",
"currentOrchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022"
}
}
Create Spot Agent Pool
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Spot.json
*/
async function createSpotAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
tags: { name1: "val1" },
vmSize: "Standard_DS1_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Spot.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS1_v2",
OSType = ContainerServiceOSType.Linux,
OrchestratorVersion = "",
ScaleSetPriority = ScaleSetPriority.Spot,
ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
Tags =
{
["name1"] = "val1"
},
NodeLabels =
{
["key1"] = "val1"
},
NodeTaints = { "Key1=Value1:NoSchedule" },
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"spotMaxPrice": -1
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"spotMaxPrice": -1
}
}
Create Windows Agent Pool with disabling OutboundNAT
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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),
},
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json
*/
async function createWindowsAgentPoolWithDisablingOutboundNat() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "wnp2";
const parameters = {
count: 3,
orchestratorVersion: "1.23.8",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
windowsProfile: { disableOutboundNat: true },
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "wnp2";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_D4s_v3",
OSType = ContainerServiceOSType.Windows,
OSSku = ContainerServiceOSSku.Windows2022,
OrchestratorVersion = "1.23.8",
IsOutboundNatDisabled = true,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.23.8",
"currentOrchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.23.8",
"currentOrchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
Create/Update Agent Pool
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Update.json
*/
async function createOrUpdateAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
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",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPoolsCreate_Update.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS1_v2",
OSType = ContainerServiceOSType.Linux,
Mode = AgentPoolMode.User,
OrchestratorVersion = "",
ScaleSetPriority = ScaleSetPriority.Spot,
ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
Tags =
{
["name1"] = "val1"
},
NodeLabels =
{
["key1"] = "val1"
},
NodeTaints = { "Key1=Value1:NoSchedule" },
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User"
}
}
Start Agent Pool
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"powerState": {
"code": "Running"
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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),
},
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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("Succeeded"),
// },
// }
}
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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Start.json
*/
async function startAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = { powerState: { code: "Running" } };
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Start.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
PowerStateCode = ContainerServiceStateCode.Running,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Starting",
"count": 50,
"enableAutoScaling": true,
"minCount": 3,
"maxCount": 55,
"powerState": {
"code": "Running"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Starting",
"count": 50,
"enableAutoScaling": true,
"minCount": 3,
"maxCount": 55,
"powerState": {
"code": "Running"
}
}
}
Stop Agent Pool
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"powerState": {
"code": "Stopped"
}
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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),
},
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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("Succeeded"),
// },
// }
}
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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Stop.json
*/
async function stopAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = { powerState: { code: "Stopped" } };
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Stop.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
PowerStateCode = ContainerServiceStateCode.Stopped,
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Stopping",
"count": 0,
"enableAutoScaling": false,
"minCount": null,
"maxCount": null,
"powerState": {
"code": "Stopped"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Stopping",
"count": 0,
"enableAutoScaling": false,
"minCount": null,
"maxCount": null,
"powerState": {
"code": "Stopped"
}
}
}
Update Agent Pool
Przykładowa prośba
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2025-10-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
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="00000000-0000-0000-0000-000000000000",
)
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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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/v8"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9cc7633f842575274f715cc02e37c5769ac2742d/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/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("<subscription-id>", 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"),
},
}, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil,
IfNoneMatch: 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 pull 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.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");
require("dotenv/config");
/**
* 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: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Update.json
*/
async function updateAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableAutoScaling: true,
maxCount: 2,
minCount: 2,
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
vmSize: "Standard_DS1_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ContainerService.Models;
using Azure.ResourceManager.ContainerService;
// Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2025-10-01/examples/AgentPools_Update.json
// this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ContainerServiceAgentPoolResource created on azure
// for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
string resourceName = "clustername1";
string agentPoolName = "agentpool1";
ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName);
ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId);
// invoke the operation
ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData
{
Count = 3,
VmSize = "Standard_DS1_v2",
OSType = ContainerServiceOSType.Linux,
MaxCount = 2,
MinCount = 2,
EnableAutoScaling = true,
OrchestratorVersion = "",
ScaleSetPriority = ScaleSetPriority.Spot,
ScaleSetEvictionPolicy = ScaleSetEvictionPolicy.Delete,
NodeTaints = { "Key1=Value1:NoSchedule" },
};
ArmOperation<ContainerServiceAgentPoolResource> lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data);
ContainerServiceAgentPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ContainerServiceAgentPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Updating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
Definicje
| Nazwa |
Opis |
|
AgentPool
|
Pula agentów.
|
|
AgentPoolGatewayProfile
|
Profil puli agentów bramy klastra zarządzanego.
|
|
AgentPoolMode
|
Tryb puli agentów. Klaster musi mieć co najmniej jedną pulę agentów "System" przez cały czas. Aby uzyskać dodatkowe informacje na temat ograniczeń puli agentów i najlepszych rozwiązań, zobacz: https://docs.microsoft.com/azure/aks/use-system-pools
|
|
AgentPoolNetworkProfile
|
Ustawienia sieciowe puli agentów.
|
|
AgentPoolSecurityProfile
|
Ustawienia zabezpieczeń puli agentów.
|
|
AgentPoolSSHAccess
|
Metoda dostępu SSH puli agentów.
|
|
AgentPoolStatus
|
Zawiera informacje tylko do odczytu dotyczące puli agentów.
|
|
AgentPoolType
|
Typ puli agentów.
|
|
AgentPoolUpgradeSettings
|
Ustawienia uaktualniania puli agentów
|
|
AgentPoolWindowsProfile
|
Określony profil puli agentów systemu Windows.
|
|
code
|
Informuje, czy klaster jest uruchomiony, czy zatrzymany
|
|
CreationData
|
Dane używane podczas tworzenia zasobu docelowego na podstawie zasobu źródłowego.
|
|
ErrorAdditionalInfo
|
Dodatkowe informacje o błędzie zarządzania zasobami.
|
|
ErrorDetail
|
Szczegóły błędu.
|
|
ErrorResponse
|
Odpowiedź na błąd
|
|
GPUDriver
|
Czy zainstalować sterowniki procesora GPU. Jeśli nie zostanie określony, wartość domyślna to Install (Zainstaluj).
|
|
GPUInstanceProfile
|
GpuInstanceProfile do użycia w celu określenia profilu wystąpienia migracji procesora GPU dla obsługiwanej jednostki SKU maszyny wirtualnej procesora GPU.
|
|
GPUProfile
|
Ustawienia procesora GPU dla puli agentów.
|
|
IPTag
|
Zawiera element IPTag skojarzony z obiektem .
|
|
KubeletConfig
|
Konfiguracje usługi Kubelet węzłów agenta. Aby uzyskać więcej informacji, zobacz konfiguracji niestandardowego węzła usługi AKS.
|
|
KubeletDiskType
|
Określa umieszczanie woluminów emptyDir, katalogu głównego danych środowiska uruchomieniowego kontenera i magazynu efemerycznego Kubelet.
|
|
LinuxOSConfig
|
Konfiguracje systemu operacyjnego węzłów agenta systemu Linux. Aby uzyskać więcej informacji, zobacz konfiguracji niestandardowego węzła usługi AKS.
|
|
LocalDNSForwardDestination
|
Serwer docelowy dla zapytań DNS, które mają być przekazywane z lokalnego DNS.
|
|
LocalDNSForwardPolicy
|
Zasady przekazywania służące do wybierania nadrzędnego serwera DNS. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
|
LocalDNSMode
|
Tryb włączania dla localDNS.
|
|
LocalDNSOverride
|
Przesłonięcia dla profilu localDNS.
|
|
LocalDNSProfile
|
Konfiguruje lokalny system DNS dla poszczególnych węzłów z przesłonięciami VnetDNS i KubeDNS. LocalDNS pomaga zwiększyć wydajność i niezawodność rozpoznawania nazw DNS w klastrze usługi AKS. Aby uzyskać więcej informacji, zobacz aka.ms/aks/localdns.
|
|
LocalDNSProtocol
|
Wymuszaj protokół TCP lub preferuj protokół UDP dla połączeń z lokalnego serwera DNS do nadrzędnego serwera DNS.
|
|
LocalDNSQueryLogging
|
Poziom dziennika dla zapytań DNS w localDNS.
|
|
LocalDNSServeStale
|
Zasady obsługi starych danych. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
|
LocalDNSState
|
Wygenerowany przez system stan localDNS.
|
|
ManualScaleProfile
|
Specyfikacje dotyczące liczby maszyn.
|
|
OSDiskType
|
Typ dysku systemu operacyjnego, który ma być używany dla maszyn w puli agentów. Wartość domyślna to "Efemeryczna", jeśli maszyna wirtualna ją obsługuje i ma dysk pamięci podręcznej większy niż żądany dysk OSDiskSizeGB. W przeciwnym razie wartość domyślna to "Zarządzane". Nie można zmienić po utworzeniu. Aby uzyskać więcej informacji, zobacz efemeryczny system operacyjny.
|
|
OSSKU
|
Określa jednostkę SKU systemu operacyjnego używaną przez pulę agentów. Wartość domyślna to Ubuntu, jeśli typ systemu operacyjnego to Linux. Wartość domyślna to Windows2019, gdy platforma Kubernetes <= 1.24 lub Windows2022, gdy platforma Kubernetes >= 1,25, jeśli typ systemu operacyjnego to Windows.
|
|
OSType
|
Typ systemu operacyjnego. Wartość domyślna to Linux.
|
|
PodIPAllocationMode
|
Tryb alokacji adresów IP zasobnika. Tryb alokacji adresów IP dla zasobników w puli agentów. Musi być używany z podSubnetId. Wartość domyślna to "DynamicIndividual".
|
|
PortRange
|
Zakres portów.
|
|
PowerState
|
Opisuje stan zasilania klastra
|
|
Protocol
|
Protokół sieciowy portu.
|
|
ScaleDownMode
|
W tym artykule opisano, jak maszyny wirtualne są dodawane do pul agentów lub usuwane z nich. Zobacz stany rozliczeń.
|
|
ScaleProfile
|
Specyfikacje dotyczące skalowania puli agentów VirtualMachines.
|
|
ScaleSetEvictionPolicy
|
Zasady eksmisji zestawu skalowania maszyn wirtualnych. Zasady eksmisji określają, co należy zrobić z maszyną wirtualną po jej eksmisji. Wartość domyślna to Usuń. Aby uzyskać więcej informacji na temat eksmisji, zobacz Maszyny wirtualne typu spot
|
|
ScaleSetPriority
|
Priorytet zestawu skalowania maszyn wirtualnych.
|
|
SysctlConfig
|
Ustawienia sysctl dla węzłów agenta systemu Linux.
|
|
UndrainableNodeBehavior
|
Definiuje zachowanie węzłów niewykonalnych podczas uaktualniania. Najczęstszą przyczyną niedostępnych węzłów jest budżety zakłóceń zasobników (PDB), ale inne problemy, takie jak okres prolongaty zakończenia zasobnika przekracza pozostały limit czasu opróżniania węzła lub zasobnik jest nadal w stanie uruchomienia, może również spowodować niezrównowadzone węzły.
|
|
VirtualMachineNodes
|
Bieżący stan w grupie węzłów o tym samym rozmiarze maszyny wirtualnej.
|
|
VirtualMachinesProfile
|
Specyfikacje w puli agentów VirtualMachines.
|
|
WorkloadRuntime
|
Określa typ obciążenia, który może uruchomić węzeł.
|
AgentPool
Sprzeciwiać się
Pula agentów.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
id
|
string
|
|
Identyfikator zasobu.
|
|
name
|
string
|
|
Nazwa zasobu, który jest unikatowy w grupie zasobów. Ta nazwa może służyć do uzyskiwania dostępu do zasobu.
|
|
properties.availabilityZones
|
string[]
|
|
Lista stref dostępności do użycia dla węzłów. Można to określić tylko wtedy, gdy właściwość AgentPoolType to "VirtualMachineScaleSets".
|
|
properties.capacityReservationGroupID
|
string
(arm-id)
|
|
Usługa AKS skojarzy określoną pulę agentów z grupą rezerwacji pojemności.
|
|
properties.count
|
integer
(int32)
|
|
Liczba agentów (maszyn wirtualnych) do hostowania kontenerów platformy Docker. Dozwolone wartości muszą należeć do zakresu od 0 do 1000 (włącznie) dla pul użytkowników i w zakresie od 1 do 1000 (włącznie) dla pul systemowych. Wartość domyślna to 1.
|
|
properties.creationData
|
CreationData
|
|
CreationData do określenia źródłowego identyfikatora migawki, jeśli pula węzłów zostanie utworzona/uaktualniona przy użyciu migawki.
|
|
properties.currentOrchestratorVersion
|
string
|
|
Wersja platformy Kubernetes, z uruchomioną pulą agentów. Jeśli orchestratorVersion jest w pełni określoną wersją <major.minor.patch>, to pole będzie dokładnie równe. Jeśli element orchestratorVersion ma wartość <major.minor>, to pole będzie zawierać pełną <wersji głównej.pomocniczej.patch> używanej.
|
|
properties.eTag
|
string
|
|
Unikatowy ciąg tylko do odczytu używany do implementowania optymistycznej współbieżności. Wartość elementu eTag zmieni się po zaktualizowaniu zasobu. Określ nagłówek if-match lub if-none-match z wartością eTag dla kolejnego żądania, aby włączyć optymistyczną współbieżność zgodnie z normalną konwencją eTag.
|
|
properties.enableAutoScaling
|
boolean
|
|
Czy włączyć automatyczne skalowanie
|
|
properties.enableEncryptionAtHost
|
boolean
|
|
Czy włączyć szyfrowanie dysków danych i systemu operacyjnego opartego na hoście. Jest to obsługiwane tylko w przypadku niektórych rozmiarów maszyn wirtualnych i w niektórych regionach świadczenia usługi Azure. Aby uzyskać więcej informacji, zobacz: https://docs.microsoft.com/azure/aks/enable-host-encryption
|
|
properties.enableFIPS
|
boolean
|
|
Czy używać systemu operacyjnego z obsługą protokołu FIPS. Aby uzyskać więcej informacji, zobacz Dodawanie puli węzłów z obsługą protokołu FIPS.
|
|
properties.enableNodePublicIP
|
boolean
|
|
Określa, czy każdy węzeł jest przydzielany do własnego publicznego adresu IP. Niektóre scenariusze mogą wymagać, aby węzły w puli węzłów odbierały własne dedykowane publiczne adresy IP. Typowy scenariusz dotyczy obciążeń gier, w których konsola musi nawiązać bezpośrednie połączenie z maszyną wirtualną w chmurze, aby zminimalizować przeskoki. Aby uzyskać więcej informacji, zobacz przypisywanie publicznego adresu IP na węzeł. Wartość domyślna to false.
|
|
properties.enableUltraSSD
|
boolean
|
|
Czy włączyć warstwę UltraSSD
|
|
properties.gatewayProfile
|
AgentPoolGatewayProfile
|
|
Profil specyficzny dla zarządzanej puli agentów w trybie bramy. Nie można ustawić tego pola, jeśli tryb puli agentów nie jest bramą.
|
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
|
GpuInstanceProfile do użycia w celu określenia profilu wystąpienia migracji procesora GPU dla obsługiwanej jednostki SKU maszyny wirtualnej procesora GPU.
|
|
properties.gpuProfile
|
GPUProfile
|
|
Ustawienia procesora GPU dla puli agentów.
|
|
properties.hostGroupID
|
string
(arm-id)
|
|
W pełni kwalifikowany identyfikator zasobu dedykowanej grupy hostów do aprowizowania maszyn wirtualnych używany tylko w scenariuszu tworzenia i nie może zmienić się po ustawieniu. Jest to formularz: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. Aby uzyskać więcej informacji, zobacz dedykowanych hostów platformy Azure.
|
|
properties.kubeletConfig
|
KubeletConfig
|
|
Konfiguracja rozwiązania Kubelet w węzłach puli agentów.
|
|
properties.kubeletDiskType
|
KubeletDiskType
|
|
Określa umieszczanie woluminów emptyDir, katalogu głównego danych środowiska uruchomieniowego kontenera i magazynu efemerycznego Kubelet.
|
|
properties.linuxOSConfig
|
LinuxOSConfig
|
|
Konfiguracja systemu operacyjnego węzłów agenta systemu Linux.
|
|
properties.localDNSProfile
|
LocalDNSProfile
|
|
Konfiguruje lokalny system DNS dla poszczególnych węzłów z przesłonięciami VnetDNS i KubeDNS. LocalDNS pomaga zwiększyć wydajność i niezawodność rozpoznawania nazw DNS w klastrze usługi AKS. Aby uzyskać więcej informacji, zobacz aka.ms/aks/localdns.
|
|
properties.maxCount
|
integer
(int32)
|
|
Maksymalna liczba węzłów do automatycznego skalowania
|
|
properties.maxPods
|
integer
(int32)
|
|
Maksymalna liczba zasobników, które mogą być uruchamiane w węźle.
|
|
properties.messageOfTheDay
|
string
|
|
Komunikat dnia dla węzłów systemu Linux zakodowany w formacie base64. Ciąg zakodowany w formacie base64, który zostanie zapisany w pliku /etc/motd po dekodowaniu. Umożliwia to dostosowanie komunikatu dnia dla węzłów systemu Linux. Nie można go określić dla węzłów systemu Windows. Musi to być ciąg statyczny (tj. zostanie wydrukowany jako nieprzetworzone i nie zostanie wykonany jako skrypt).
|
|
properties.minCount
|
integer
(int32)
|
|
Minimalna liczba węzłów do automatycznego skalowania
|
|
properties.mode
|
AgentPoolMode
|
|
Tryb puli agentów. Klaster musi mieć co najmniej jedną pulę agentów "System" przez cały czas. Aby uzyskać dodatkowe informacje na temat ograniczeń puli agentów i najlepszych rozwiązań, zobacz: https://docs.microsoft.com/azure/aks/use-system-pools
|
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
|
Ustawienia związane z siecią puli agentów.
|
|
properties.nodeImageVersion
|
string
|
|
Wersja obrazu węzła
|
|
properties.nodeLabels
|
object
|
|
Etykiety węzłów, które mają być utrwalane we wszystkich węzłach w puli agentów.
|
|
properties.nodePublicIPPrefixID
|
string
(arm-id)
|
|
Identyfikator prefiksu publicznego adresu IP, z którego węzły maszyny wirtualnej powinny używać adresów IP. Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}
|
|
properties.nodeTaints
|
string[]
|
|
Defekty dodane do nowych węzłów podczas tworzenia i skalowania puli węzłów. Na przykład key=value:NoSchedule.
|
|
properties.orchestratorVersion
|
string
|
|
Wersja platformy Kubernetes określona przez użytkownika. Obsługiwane są obie wersje poprawek <major.minor.patch> (np. 1.20.13) i <major.minor> (np. 1.20). Po określeniu <główna.pomocnicza> jest wybierana automatycznie najnowsza obsługiwana wersja poprawki ogólnie dostępnej. Aktualizowanie klastra przy użyciu tego samego <major.minor> po jego utworzeniu (np. 1.14.x —> 1.14) nie wyzwoli uaktualnienia, nawet jeśli jest dostępna nowsza wersja poprawki. Najlepszym rozwiązaniem jest uaktualnienie wszystkich pul węzłów w klastrze usługi AKS do tej samej wersji rozwiązania Kubernetes. Wersja puli węzłów musi mieć taką samą wersję główną jak płaszczyzna sterowania. Wersja pomocnicza puli węzłów musi należeć do dwóch wersji pomocniczych wersji płaszczyzny sterowania. Wersja puli węzłów nie może być większa niż wersja płaszczyzny sterowania. Aby uzyskać więcej informacji, zobacz uaktualnianie puli węzłów.
|
|
properties.osDiskSizeGB
|
integer
(int32)
minimum: 0 maximum: 2048
|
|
Rozmiar dysku systemu operacyjnego w GB do określenia rozmiaru dysku dla każdej maszyny w puli głównej/agenta. Jeśli określisz wartość 0, zostanie zastosowana domyślna wartość osDisk size zgodnie z określoną wartością vmSize.
|
|
properties.osDiskType
|
OSDiskType
|
|
Typ dysku systemu operacyjnego, który ma być używany dla maszyn w puli agentów. Wartość domyślna to "Efemeryczna", jeśli maszyna wirtualna ją obsługuje i ma dysk pamięci podręcznej większy niż żądany dysk OSDiskSizeGB. W przeciwnym razie wartość domyślna to "Zarządzane". Nie można zmienić po utworzeniu. Aby uzyskać więcej informacji, zobacz efemeryczny system operacyjny.
|
|
properties.osSKU
|
OSSKU
|
|
Określa jednostkę SKU systemu operacyjnego używaną przez pulę agentów. Wartość domyślna to Ubuntu, jeśli typ systemu operacyjnego to Linux. Wartość domyślna to Windows2019, gdy platforma Kubernetes <= 1.24 lub Windows2022, gdy platforma Kubernetes >= 1,25, jeśli typ systemu operacyjnego to Windows.
|
|
properties.osType
|
OSType
|
Linux
|
Typ systemu operacyjnego. Wartość domyślna to Linux.
|
|
properties.podIPAllocationMode
|
PodIPAllocationMode
|
|
Tryb alokacji adresów IP zasobnika. Tryb alokacji adresów IP dla zasobników w puli agentów. Musi być używany z podSubnetId. Wartość domyślna to "DynamicIndividual".
|
|
properties.podSubnetID
|
string
(arm-id)
|
|
Identyfikator podsieci, która zasobniki zostaną przyłączone po uruchomieniu. W przypadku pominięcia adresy IP zasobników są statycznie przypisywane w podsieci węzła (zobacz vnetSubnetID, aby uzyskać więcej informacji). Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
|
properties.powerState
|
PowerState
|
|
Niezależnie od tego, czy pula agentów jest uruchomiona, czy zatrzymana. Po pierwszym utworzeniu puli agentów jest ona początkowo uruchomiona. Pulę agentów można zatrzymać, ustawiając to pole na Zatrzymano. Zatrzymana pula agentów zatrzymuje wszystkie maszyny wirtualne i nie nalicza opłat za rozliczenia. Pulę agentów można zatrzymać tylko wtedy, gdy jest uruchomiona, a stan aprowizacji to Powodzenie
|
|
properties.provisioningState
|
string
|
|
Bieżący stan wdrożenia lub aprowizacji.
|
|
properties.proximityPlacementGroupID
|
string
(arm-id)
|
|
Identyfikator grupy umieszczania w pobliżu.
|
|
properties.scaleDownMode
|
ScaleDownMode
|
|
Tryb skalowania w dół używany podczas skalowania puli agentów. Ma to również wpływ na zachowanie narzędzia do automatycznego skalowania klastra. Jeśli nie zostanie określony, domyślnie ma wartość Usuń.
|
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Delete
|
Zasady eksmisji zestawu skalowania maszyn wirtualnych do użycia. Nie można tego określić, chyba że element scaleSetPriority ma wartość "Spot". Jeśli nie zostanie określony, wartość domyślna to "Usuń".
|
|
properties.scaleSetPriority
|
ScaleSetPriority
|
Regular
|
Priorytet zestawu skalowania maszyn wirtualnych. Jeśli nie zostanie określony, wartość domyślna to "Regular".
|
|
properties.securityProfile
|
AgentPoolSecurityProfile
|
|
Ustawienia zabezpieczeń puli agentów.
|
|
properties.spotMaxPrice
|
number
|
-1
|
Maksymalna cena (w dolarach amerykańskich) jest gotowa zapłacić za wystąpienia typu spot. Możliwe wartości to dowolna wartość dziesiętna większa niż zero lub -1, która wskazuje, że domyślna cena ma być up-to na żądanie. Możliwe wartości to dowolna wartość dziesiętna większa niż zero lub -1, która wskazuje gotowość do zapłaty dowolnej ceny na żądanie. Aby uzyskać więcej informacji na temat cennika typu spot, zobacz cennik maszyn wirtualnych typu spot
|
|
properties.status
|
AgentPoolStatus
|
|
Zawiera informacje tylko do odczytu dotyczące puli agentów.
|
|
properties.tags
|
object
|
|
Tagi, które mają być utrwalane w zestawie skalowania maszyn wirtualnych puli agentów.
|
|
properties.type
|
AgentPoolType
|
|
Typ puli agentów.
|
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
|
Ustawienia uaktualniania puli agentów
|
|
properties.virtualMachineNodesStatus
|
VirtualMachineNodes[]
|
|
Stan węzłów w puli agentów VirtualMachines.
|
|
properties.virtualMachinesProfile
|
VirtualMachinesProfile
|
|
Specyfikacje w puli agentów VirtualMachines.
|
|
properties.vmSize
|
string
|
|
Rozmiar maszyn wirtualnych puli agentów. Dostępność rozmiaru maszyny wirtualnej różni się w zależności od regionu. Jeśli węzeł zawiera niewystarczające zasoby obliczeniowe (pamięć, procesor itp.), zasobniki mogą nie działać poprawnie. Aby uzyskać więcej informacji na temat ograniczonych rozmiarów maszyn wirtualnych, zobacz: https://docs.microsoft.com/azure/aks/quotas-skus-regions
|
|
properties.vnetSubnetID
|
string
(arm-id)
|
|
Identyfikator podsieci, która węzły puli agentów i opcjonalnie zasobniki zostaną przyłączone podczas uruchamiania. Jeśli ta wartość nie zostanie określona, zostanie wygenerowana i użyta sieć wirtualna oraz podsieć. Jeśli nie określono parametru podSubnetID, dotyczy to węzłów i zasobników, w przeciwnym razie dotyczy tylko węzłów. Jest to forma: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
|
Określony profil puli agentów systemu Windows.
|
|
properties.workloadRuntime
|
WorkloadRuntime
|
|
Określa typ obciążenia, który może uruchomić węzeł.
|
|
type
|
string
|
|
Typ zasobu
|
AgentPoolGatewayProfile
Sprzeciwiać się
Profil puli agentów bramy klastra zarządzanego.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
publicIPPrefixSize
|
integer
(int32)
minimum: 28 maximum: 31
|
31
|
Pula agentów bramy kojarzy jeden publiczny adres IPPrefiks dla każdej statycznej bramy ruchu wychodzącego w celu zapewnienia publicznego ruchu wychodzącego. Rozmiar publicznego prefiksu IP należy wybrać przez użytkownika. Każdy węzeł w puli agentów jest przypisywany z jednego adresu IP z prefiksu IP. Rozmiar ipPrefix służy zatem jako limit rozmiaru puli agentów bramy. Ze względu na ograniczenie rozmiaru publicznego adresu IP platformy Azure prawidłowy zakres wartości to [28, 31] (/31 = 2 węzły/adresy IP, /30 = 4 węzły/adresy IP, /29 = 8 węzłów/adresów IP, /28 = 16 węzłów/adresów IP). Wartość domyślna to 31.
|
AgentPoolMode
Wyliczenie
Tryb puli agentów. Klaster musi mieć co najmniej jedną pulę agentów "System" przez cały czas. Aby uzyskać dodatkowe informacje na temat ograniczeń puli agentów i najlepszych rozwiązań, zobacz: https://docs.microsoft.com/azure/aks/use-system-pools
| Wartość |
Opis |
|
System
|
Pule agentów systemowych służą głównie do hostowania krytycznych zasobników systemowych, takich jak CoreDNS i serwer metryk. Systemowe pule agentów osType muszą mieć wartość Linux. Jednostka SKU maszyny wirtualnej pul agentów systemowych musi mieć co najmniej 2 procesory wirtualne i 4 GB pamięci.
|
|
User
|
Pule agentów użytkowników służą głównie do hostowania zasobników aplikacji.
|
|
Gateway
|
Pule agentów bramy są przeznaczone do dostarczania statycznych adresów IP ruchu wychodzącego do zasobników. Aby uzyskać więcej informacji, zobacz https://aka.ms/aks/static-egress-gateway.
|
AgentPoolNetworkProfile
Sprzeciwiać się
Ustawienia sieciowe puli agentów.
| Nazwa |
Typ |
Opis |
|
allowedHostPorts
|
PortRange[]
|
Zakresy portów, do których można uzyskać dostęp. Określone zakresy mogą się nakładać.
|
|
applicationSecurityGroups
|
string[]
(arm-id)
|
Identyfikatory grup zabezpieczeń aplikacji, które pula agentów zostanie skojarzona podczas tworzenia.
|
|
nodePublicIPTags
|
IPTag[]
|
IpTags publicznych adresów IP na poziomie wystąpienia.
|
AgentPoolSecurityProfile
Sprzeciwiać się
Ustawienia zabezpieczeń puli agentów.
| Nazwa |
Typ |
Opis |
|
enableSecureBoot
|
boolean
|
Bezpieczny rozruch to funkcja zaufanego uruchamiania, która zapewnia możliwość rozruchu tylko podpisanych systemów operacyjnych i sterowników. Aby uzyskać więcej informacji, zobacz aka.ms/aks/trustedlaunch. Jeśli nie zostanie określony, wartość domyślna to false.
|
|
enableVTPM
|
boolean
|
VTPM to funkcja zaufanego uruchamiania do konfigurowania dedykowanego bezpiecznego magazynu dla kluczy i pomiarów przechowywanych lokalnie w węźle. Aby uzyskać więcej informacji, zobacz aka.ms/aks/trustedlaunch. Jeśli nie zostanie określony, wartość domyślna to false.
|
|
sshAccess
|
AgentPoolSSHAccess
|
Metoda dostępu SSH puli agentów.
|
AgentPoolSSHAccess
Wyliczenie
Metoda dostępu SSH puli agentów.
| Wartość |
Opis |
|
LocalUser
|
Protokół SSH może znajdować się w węźle jako użytkownik lokalny przy użyciu klucza prywatnego.
|
|
Disabled
|
Usługa SSH zostanie wyłączona w węźle.
|
AgentPoolStatus
Sprzeciwiać się
Zawiera informacje tylko do odczytu dotyczące puli agentów.
| Nazwa |
Typ |
Opis |
|
provisioningError
|
ErrorDetail
|
Szczegółowe informacje o błędzie puli agentów. Zachowuje szczegółowe informacje o niepowodzeniu. Jeśli nie wystąpił błąd, to pole jest pomijane.
|
AgentPoolType
Wyliczenie
Typ puli agentów.
| Wartość |
Opis |
|
VirtualMachineScaleSets
|
Utwórz pulę agentów wspieraną przez zestaw skalowania maszyn wirtualnych.
|
|
AvailabilitySet
|
Korzystanie z tego jest zdecydowanie odradzane.
|
|
VirtualMachines
|
Utwórz pulę agentów wspieraną przez tryb aranżacji maszyny wirtualnej o pojedynczym wystąpieniu.
|
AgentPoolUpgradeSettings
Sprzeciwiać się
Ustawienia uaktualniania puli agentów
| Nazwa |
Typ |
Opis |
|
drainTimeoutInMinutes
|
integer
(int32)
minimum: 1 maximum: 1440
|
Limit czasu opróżniania węzła. Czas oczekiwania (w minutach) na eksmisję zasobników i łagodne zakończenie na węzeł. Ten czas oczekiwania eksmisji honoruje oczekiwanie na budżety zakłóceń zasobników. Jeśli ten czas zostanie przekroczony, uaktualnienie zakończy się niepowodzeniem. Jeśli nie zostanie określony, wartość domyślna to 30 minut.
|
|
maxSurge
|
string
|
Maksymalna liczba lub procent węzłów, które są przesiąknięci podczas uaktualniania. Można to ustawić na liczbę całkowitą (np. "5") lub wartość procentową (np. "50%"). Jeśli określono wartość procentową, jest to procent całkowitego rozmiaru puli agentów w momencie uaktualnienia. W przypadku wartości procentowych węzły ułamkowe są zaokrąglane w górę. Jeśli nie zostanie określony, wartość domyślna to 10%. Aby uzyskać więcej informacji, w tym najlepsze rozwiązania, zobacz: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster
|
|
maxUnavailable
|
string
|
Maksymalna liczba lub procent węzłów, które mogą być jednocześnie niedostępne podczas uaktualniania. Można to ustawić na liczbę całkowitą (np. "1") lub wartość procentową (np. "5%"). Jeśli określono wartość procentową, jest to procent całkowitego rozmiaru puli agentów w momencie uaktualnienia. W przypadku wartości procentowych węzły ułamkowe są zaokrąglane w górę. Jeśli nie zostanie określony, wartość domyślna to 0. Aby uzyskać więcej informacji, w tym najlepsze rozwiązania, zobacz: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster
|
|
nodeSoakDurationInMinutes
|
integer
(int32)
minimum: 0 maximum: 30
|
Czas trwania zanurzania dla węzła. Czas oczekiwania (w minutach) po opróżnieniu węzła i przed ponownym utworzeniem i przejściem do następnego węzła. Jeśli nie zostanie określony, wartość domyślna to 0 minut.
|
|
undrainableNodeBehavior
|
UndrainableNodeBehavior
|
Definiuje zachowanie węzłów niewykonalnych podczas uaktualniania. Najczęstszą przyczyną niedostępnych węzłów jest budżety zakłóceń zasobników (PDB), ale inne problemy, takie jak okres prolongaty zakończenia zasobnika przekracza pozostały limit czasu opróżniania węzła lub zasobnik jest nadal w stanie uruchomienia, może również spowodować niezrównowadzone węzły.
|
AgentPoolWindowsProfile
Sprzeciwiać się
Określony profil puli agentów systemu Windows.
| Nazwa |
Typ |
Opis |
|
disableOutboundNat
|
boolean
|
Określa, czy wyłączyć funkcję OutboundNAT w węzłach systemu Windows. Wartość domyślna to fałsz. Translator adresów sieciowych dla ruchu wychodzącego można wyłączyć tylko wtedy, gdy klaster outboundType jest bramą translatora adresów sieciowych, a pula agentów systemu Windows nie ma włączonego publicznego adresu IP węzła.
|
code
Wyliczenie
Informuje, czy klaster jest uruchomiony, czy zatrzymany
| Wartość |
Opis |
|
Running
|
Klaster jest uruchomiony.
|
|
Stopped
|
Klaster zostanie zatrzymany.
|
CreationData
Sprzeciwiać się
Dane używane podczas tworzenia zasobu docelowego na podstawie zasobu źródłowego.
| Nazwa |
Typ |
Opis |
|
sourceResourceId
|
string
(arm-id)
|
Jest to identyfikator ARM obiektu źródłowego, który ma zostać użyty do utworzenia obiektu docelowego.
|
ErrorAdditionalInfo
Sprzeciwiać się
Dodatkowe informacje o błędzie zarządzania zasobami.
| Nazwa |
Typ |
Opis |
|
info
|
object
|
Dodatkowe informacje.
|
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorDetail
Sprzeciwiać się
Szczegóły błędu.
| Nazwa |
Typ |
Opis |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
|
code
|
string
|
Kod błędu.
|
|
details
|
ErrorDetail[]
|
Szczegóły błędu.
|
|
message
|
string
|
Komunikat o błędzie.
|
|
target
|
string
|
Element docelowy błędu.
|
ErrorResponse
Sprzeciwiać się
Odpowiedź na błąd
GPUDriver
Wyliczenie
Czy zainstalować sterowniki procesora GPU. Jeśli nie zostanie określony, wartość domyślna to Install (Zainstaluj).
| Wartość |
Opis |
|
Install
|
Zainstaluj sterownik.
|
|
None
|
Pomiń instalację sterownika.
|
GPUInstanceProfile
Wyliczenie
GpuInstanceProfile do użycia w celu określenia profilu wystąpienia migracji procesora GPU dla obsługiwanej jednostki SKU maszyny wirtualnej procesora GPU.
| Wartość |
Opis |
|
MIG1g
|
|
|
MIG2g
|
|
|
MIG3g
|
|
|
MIG4g
|
|
|
MIG7g
|
|
GPUProfile
Sprzeciwiać się
Ustawienia procesora GPU dla puli agentów.
| Nazwa |
Typ |
Opis |
|
driver
|
GPUDriver
|
Czy zainstalować sterowniki procesora GPU. Jeśli nie zostanie określony, wartość domyślna to Install (Zainstaluj).
|
IPTag
Sprzeciwiać się
Zawiera element IPTag skojarzony z obiektem .
| Nazwa |
Typ |
Opis |
|
ipTagType
|
string
|
Typ tagu IP. Przykład: RoutingPreference.
|
|
tag
|
string
|
Wartość tagu IP skojarzonego z publicznym adresem IP. Przykład: Internet.
|
KubeletConfig
Sprzeciwiać się
Konfiguracje usługi Kubelet węzłów agenta. Aby uzyskać więcej informacji, zobacz konfiguracji niestandardowego węzła usługi AKS.
| Nazwa |
Typ |
Opis |
|
allowedUnsafeSysctls
|
string[]
|
Dozwolona lista niebezpiecznych wzorców sysctl lub niebezpiecznych wzorców sysctl (kończących się na ).*
|
|
containerLogMaxFiles
|
integer
(int32)
minimum: 2
|
Maksymalna liczba plików dziennika kontenera, które mogą być obecne dla kontenera. Liczba musi być ≥ 2.
|
|
containerLogMaxSizeMB
|
integer
(int32)
|
Maksymalny rozmiar (np. 10Mi) pliku dziennika kontenera przed jego obróceniu.
|
|
cpuCfsQuota
|
boolean
|
Jeśli wymuszanie limitów przydziału procesora CPU CFS jest włączone dla kontenerów, które określają limity procesora CPU. Wartość domyślna to true.
|
|
cpuCfsQuotaPeriod
|
string
|
Wartość okresu limitu przydziału procesora CPU CFS. Wartość domyślna to "100 ms". Prawidłowe wartości to sekwencja liczb dziesiętnych z opcjonalnym ułamkiem i sufiksem jednostki. Na przykład: "300 ms", "2h45m". Obsługiwane jednostki to "ns", "us", "ms", "s", "m" i "h".
|
|
cpuManagerPolicy
|
string
|
Zasady menedżera procesora CPU do użycia. Wartość domyślna to "none". Aby uzyskać więcej informacji, zobacz Zasady zarządzania procesorami CPU platformy Kubernetes . Dozwolone wartości to "none" i "static".
|
|
failSwapOn
|
boolean
|
Jeśli ustawiono wartość true, uruchomienie polecenia Kubelet zakończy się niepowodzeniem, jeśli zamiana jest włączona w węźle.
|
|
imageGcHighThreshold
|
integer
(int32)
|
Procent użycia dysku, po którym odzyskiwanie pamięci obrazu jest zawsze uruchamiane. Aby wyłączyć odzyskiwanie pamięci obrazu, ustaw wartość 100. Wartość domyślna to 85%
|
|
imageGcLowThreshold
|
integer
(int32)
|
Procent użycia dysku, przed którym odzyskiwanie pamięci obrazu nigdy nie jest uruchamiane. Nie można ustawić tej wartości wyższej niż imageGcHighThreshold. Wartość domyślna to 80%
|
|
podMaxPids
|
integer
(int32)
|
Maksymalna liczba procesów na zasobnik.
|
|
topologyManagerPolicy
|
string
|
Zasady Menedżera topologii do użycia. Aby uzyskać więcej informacji, zobacz Kubernetes Topology Manager. Wartość domyślna to "none". Dozwolone wartości to "none", "best-effort", "restricted" i "single-numa-node".
|
KubeletDiskType
Wyliczenie
Określa umieszczanie woluminów emptyDir, katalogu głównego danych środowiska uruchomieniowego kontenera i magazynu efemerycznego Kubelet.
| Wartość |
Opis |
|
OS
|
Kubelet użyje dysku systemu operacyjnego dla swoich danych.
|
|
Temporary
|
Kubelet użyje dysku tymczasowego dla swoich danych.
|
LinuxOSConfig
Sprzeciwiać się
Konfiguracje systemu operacyjnego węzłów agenta systemu Linux. Aby uzyskać więcej informacji, zobacz konfiguracji niestandardowego węzła usługi AKS.
| Nazwa |
Typ |
Opis |
|
swapFileSizeMB
|
integer
(int32)
|
Rozmiar w MB pliku wymiany, który zostanie utworzony w każdym węźle.
|
|
sysctls
|
SysctlConfig
|
Ustawienia sysctl dla węzłów agenta systemu Linux.
|
|
transparentHugePageDefrag
|
string
|
Czy jądro powinno zwiększyć wykorzystanie kompaktowania pamięci w celu udostępnienia większej liczby ogromnych stron. Prawidłowe wartości to "always", "defer", "defer+madvise", "madvise" i "never". Wartość domyślna to "madvise". Aby uzyskać więcej informacji, zobacz Transparent Hugepages.
|
|
transparentHugePageEnabled
|
string
|
Czy włączono przezroczyste ogromne strony. Prawidłowe wartości to "always", "madvise" i "never". Wartość domyślna to "zawsze". Aby uzyskać więcej informacji, zobacz Transparent Hugepages.
|
LocalDNSForwardDestination
Wyliczenie
Serwer docelowy dla zapytań DNS, które mają być przekazywane z lokalnego DNS.
| Wartość |
Opis |
|
ClusterCoreDNS
|
Przekazywanie zapytań DNS z lokalnego systemu DNS do klastra CoreDNS.
|
|
VnetDNS
|
Przekazywanie zapytań DNS z lokalnego systemu DNS do serwera DNS skonfigurowanego w sieci wirtualnej. Sieć wirtualna może mieć skonfigurowanych wiele serwerów DNS.
|
LocalDNSForwardPolicy
Wyliczenie
Zasady przekazywania służące do wybierania nadrzędnego serwera DNS. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
| Wartość |
Opis |
|
Sequential
|
Implementuje sekwencyjny wybór nadrzędnego serwera DNS. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
|
RoundRobin
|
Implementuje wybór nadrzędnego serwera DNS działającego okrężnie. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
|
Random
|
Implementuje losowy wybór nadrzędnego serwera DNS. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
LocalDNSMode
Wyliczenie
Tryb włączania dla localDNS.
| Wartość |
Opis |
|
Preferred
|
Jeśli bieżąca wersja programu Orchestrator obsługuje tę funkcję, preferuj włączenie localDNS.
|
|
Required
|
Włącz localDNS.
|
|
Disabled
|
Wyłącz localDNS.
|
LocalDNSOverride
Sprzeciwiać się
Przesłonięcia dla profilu localDNS.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
cacheDurationInSeconds
|
integer
(int32)
|
3600
|
Maksymalny czas wygaśnięcia pamięci podręcznej w kilka sekund. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
|
forwardDestination
|
LocalDNSForwardDestination
|
ClusterCoreDNS
|
Serwer docelowy dla zapytań DNS, które mają być przekazywane z lokalnego DNS.
|
|
forwardPolicy
|
LocalDNSForwardPolicy
|
Sequential
|
Zasady przekazywania służące do wybierania nadrzędnego serwera DNS. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
|
maxConcurrent
|
integer
(int32)
|
1000
|
Maksymalna liczba współbieżnych zapytań. Zobacz wtyczkę do przekazywania , aby uzyskać więcej informacji.
|
|
protocol
|
LocalDNSProtocol
|
PreferUDP
|
Wymuszaj protokół TCP lub preferuj protokół UDP dla połączeń z lokalnego serwera DNS do nadrzędnego serwera DNS.
|
|
queryLogging
|
LocalDNSQueryLogging
|
Error
|
Poziom dziennika dla zapytań DNS w localDNS.
|
|
serveStale
|
LocalDNSServeStale
|
Immediate
|
Zasady obsługi starych danych. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
|
serveStaleDurationInSeconds
|
integer
(int32)
|
3600
|
Podawaj nieświeży czas trwania w kilka sekund. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
LocalDNSProfile
Sprzeciwiać się
Konfiguruje lokalny system DNS dla poszczególnych węzłów z przesłonięciami VnetDNS i KubeDNS. LocalDNS pomaga zwiększyć wydajność i niezawodność rozpoznawania nazw DNS w klastrze usługi AKS. Aby uzyskać więcej informacji, zobacz aka.ms/aks/localdns.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
kubeDNSOverrides
|
<string,
LocalDNSOverride>
|
|
Przesłonięcia KubeDNS mają zastosowanie do ruchu DNS z zasobników z dnsPolicy:ClusterFirst (określanym jako ruch KubeDNS).
|
|
mode
|
LocalDNSMode
|
Preferred
|
Tryb włączania dla localDNS.
|
|
state
|
LocalDNSState
|
|
Wygenerowany przez system stan localDNS.
|
|
vnetDNSOverrides
|
<string,
LocalDNSOverride>
|
|
Przesłonięcia VnetDNS mają zastosowanie do ruchu DNS z zasobników z dnsPolicy:default lub kubelet (określanych jako ruch VnetDNS).
|
LocalDNSProtocol
Wyliczenie
Wymuszaj protokół TCP lub preferuj protokół UDP dla połączeń z lokalnego serwera DNS do nadrzędnego serwera DNS.
| Wartość |
Opis |
|
PreferUDP
|
Preferowany protokół UDP dla połączeń z lokalnego serwera DNS do nadrzędnego serwera DNS.
|
|
ForceTCP
|
Wymuszaj protokół TCP dla połączeń z lokalnego serwera DNS do nadrzędnego serwera DNS.
|
LocalDNSQueryLogging
Wyliczenie
Poziom dziennika dla zapytań DNS w localDNS.
| Wartość |
Opis |
|
Error
|
Włącza rejestrowanie błędów w localDNS. Zobacz wtyczkę błędów , aby uzyskać więcej informacji.
|
|
Log
|
Włącza rejestrowanie zapytań w localDNS. Aby uzyskać więcej informacji, zobacz wtyczkę dziennika .
|
LocalDNSServeStale
Wyliczenie
Zasady obsługi starych danych. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
| Wartość |
Opis |
|
Verify
|
Obsługuj nieaktualne dane z weryfikacją. Najpierw sprawdź, czy wpis jest nadal niedostępny w źródle przed wysłaniem wygasłego wpisu do klienta. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
|
Immediate
|
Natychmiast obsługuj przestarzałe dane. Wyślij wygasły wpis do klienta przed sprawdzeniem, czy wpis jest dostępny w źródle. Zobacz wtyczkę pamięci podręcznej , aby uzyskać więcej informacji.
|
|
Disable
|
Wyłącz obsługę starych danych.
|
LocalDNSState
Wyliczenie
Wygenerowany przez system stan localDNS.
| Wartość |
Opis |
|
Enabled
|
localDNS jest włączony.
|
|
Disabled
|
localDNS jest wyłączony.
|
ManualScaleProfile
Sprzeciwiać się
Specyfikacje dotyczące liczby maszyn.
| Nazwa |
Typ |
Opis |
|
count
|
integer
(int32)
|
Liczba węzłów.
|
|
size
|
string
|
Rozmiar maszyny wirtualnej używany przez usługę AKS podczas tworzenia i skalowania, np. "Standard_E4s_v3", "Standard_E16s_v3" lub "Standard_D16s_v5".
|
OSDiskType
Wyliczenie
Typ dysku systemu operacyjnego, który ma być używany dla maszyn w puli agentów. Wartość domyślna to "Efemeryczna", jeśli maszyna wirtualna ją obsługuje i ma dysk pamięci podręcznej większy niż żądany dysk OSDiskSizeGB. W przeciwnym razie wartość domyślna to "Zarządzane". Nie można zmienić po utworzeniu. Aby uzyskać więcej informacji, zobacz efemeryczny system operacyjny.
| Wartość |
Opis |
|
Managed
|
Platforma Azure replikuje dysk systemu operacyjnego dla maszyny wirtualnej do usługi Azure Storage, aby uniknąć utraty danych w przypadku konieczności przeniesienia maszyny wirtualnej na inny host. Ponieważ kontenery nie są zaprojektowane tak, aby stan lokalny był utrwalany, to zachowanie zapewnia ograniczoną wartość, zapewniając pewne wady, w tym wolniejsze aprowizowanie węzłów i większe opóźnienie odczytu/zapisu.
|
|
Ephemeral
|
Efemeryczne dyski systemu operacyjnego są przechowywane tylko na maszynie hosta, podobnie jak dysk tymczasowy. Zapewnia to mniejsze opóźnienie odczytu/zapisu oraz szybsze skalowanie węzłów i uaktualnienia klastra.
|
OSSKU
Wyliczenie
Określa jednostkę SKU systemu operacyjnego używaną przez pulę agentów. Wartość domyślna to Ubuntu, jeśli typ systemu operacyjnego to Linux. Wartość domyślna to Windows2019, gdy platforma Kubernetes <= 1.24 lub Windows2022, gdy platforma Kubernetes >= 1,25, jeśli typ systemu operacyjnego to Windows.
| Wartość |
Opis |
|
AzureLinux
|
Użyj usługi AzureLinux jako systemu operacyjnego dla obrazów węzłów. Azure Linux to zoptymalizowana pod kątem kontenera dystrybucja systemu Linux utworzona przez firmę Microsoft, odwiedź stronę https://aka.ms/azurelinux, aby uzyskać więcej informacji.
|
|
AzureLinux3
|
Użyj AzureLinux3 jako systemu operacyjnego dla obrazów węzłów. Azure Linux to zoptymalizowana pod kątem kontenera dystrybucja systemu Linux utworzona przez firmę Microsoft, odwiedź stronę https://aka.ms/azurelinux, aby uzyskać więcej informacji. Aby zapoznać się z ograniczeniami, odwiedź stronę https://aka.ms/aks/node-images. Aby uzyskać wskazówki dotyczące migracji systemu operacyjnego, zobacz https://aka.ms/aks/upgrade-os-version.
|
|
CBLMariner
|
Przestarzałe jednostki OSSKU. Firma Microsoft zaleca, aby nowe wdrożenia zamiast tego wybierały pozycję "AzureLinux".
|
|
Ubuntu
|
Użyj systemu Ubuntu jako systemu operacyjnego dla obrazów węzłów.
|
|
Ubuntu2204
|
Użyj Ubuntu2204 jako systemu operacyjnego dla obrazów węzłów, jednak Ubuntu 22.04 może nie być obsługiwany dla wszystkich pul węzłów. Aby uzyskać informacje o ograniczeniach i obsługiwanych wersjach kubernetes, zobacz https://aka.ms/aks/supported-ubuntu-versions
|
|
Ubuntu2404
|
Użyj Ubuntu2404 jako systemu operacyjnego dla obrazów węzłów, jednak system Ubuntu 24.04 może nie być obsługiwany dla wszystkich pul węzłów. Aby uzyskać informacje o ograniczeniach i obsługiwanych wersjach kubernetes, zobacz https://aka.ms/aks/supported-ubuntu-versions
|
|
Windows2019
|
Użyj systemu Windows2019 jako systemu operacyjnego dla obrazów węzłów. Nieobsługiwane dla pul węzłów systemowych. System Windows2019 obsługuje tylko kontenery systemu Windows2019; Nie można uruchomić kontenerów systemu Windows2022 i na odwrót.
|
|
Windows2022
|
Użyj systemu Windows2022 jako systemu operacyjnego dla obrazów węzłów. Nieobsługiwane dla pul węzłów systemowych. System Windows2022 obsługuje tylko kontenery systemu Windows2022; nie może uruchamiać kontenerów systemu Windows 2019 i na odwrót.
|
OSType
Wyliczenie
Typ systemu operacyjnego. Wartość domyślna to Linux.
| Wartość |
Opis |
|
Linux
|
Użyj Linuksa.
|
|
Windows
|
Korzystanie z systemu Windows.
|
PodIPAllocationMode
Wyliczenie
Tryb alokacji adresów IP zasobnika. Tryb alokacji adresów IP dla zasobników w puli agentów. Musi być używany z podSubnetId. Wartość domyślna to "DynamicIndividual".
| Wartość |
Opis |
|
DynamicIndividual
|
Każdy węzeł jest przydzielany z nieciągłą listą adresów IP, które można przypisać do zasobników. Jest to lepsze rozwiązanie do maksymalizacji małej lub średniej podsieci o rozmiarze /16 lub mniejszym. Klaster usługi Azure CNI z dynamiczną alokacją adresów IP domyślnie korzysta z tego trybu, jeśli klient nie określi jawnie podIPAllocationMode
|
|
StaticBlock
|
Każdy węzeł jest statycznie przydzielany blok(i) CIDR o rozmiarze /28 = 16 adresów IP na blok, aby spełnić maksymalną liczbę adresów IP na węzeł. Liczba bloków CIDR >= (maxPods / 16). Blok, a nie pojedynczy adres IP, liczy się na limit prywatnych adresów IP sieci wirtualnej platformy Azure 65K. W związku z tym tryb blokowy nadaje się do uruchamiania większych obciążeń z większym limitem 65 tys. zasobników w klastrze. Ten tryb lepiej nadaje się do skalowania z większymi podsieciami /15 lub większymi
|
PortRange
Sprzeciwiać się
Zakres portów.
| Nazwa |
Typ |
Opis |
|
portEnd
|
integer
(int32)
minimum: 1 maximum: 65535
|
Maksymalny port uwzględniony w zakresie. Powinien on zawierać zakres od 1 do 65535 i być większy niż lub równy portStart.
|
|
portStart
|
integer
(int32)
minimum: 1 maximum: 65535
|
Minimalny port uwzględniony w zakresie. Powinien on być z zakresu od 1 do 65535 i być mniejszy lub równy portEnd.
|
|
protocol
|
Protocol
|
Protokół sieciowy portu.
|
PowerState
Sprzeciwiać się
Opisuje stan zasilania klastra
| Nazwa |
Typ |
Opis |
|
code
|
code
|
Informuje, czy klaster jest uruchomiony, czy zatrzymany
|
Protocol
Wyliczenie
Protokół sieciowy portu.
| Wartość |
Opis |
|
TCP
|
Protokół TCP.
|
|
UDP
|
Protokół UDP.
|
ScaleDownMode
Wyliczenie
W tym artykule opisano, jak maszyny wirtualne są dodawane do pul agentów lub usuwane z nich. Zobacz stany rozliczeń.
| Wartość |
Opis |
|
Delete
|
Tworzenie nowych wystąpień podczas skalowania w górę i usuwanie wystąpień podczas skalowania w dół.
|
|
Deallocate
|
Spróbuj uruchomić wystąpienia o cofniętej alokacji (jeśli istnieją) podczas skalowania w górę i cofnąć alokację wystąpień podczas skalowania w dół.
|
ScaleProfile
Sprzeciwiać się
Specyfikacje dotyczące skalowania puli agentów VirtualMachines.
| Nazwa |
Typ |
Opis |
|
manual
|
ManualScaleProfile[]
|
Specyfikacje dotyczące sposobu skalowania puli agentów VirtualMachines do stałego rozmiaru.
|
ScaleSetEvictionPolicy
Wyliczenie
Zasady eksmisji zestawu skalowania maszyn wirtualnych. Zasady eksmisji określają, co należy zrobić z maszyną wirtualną po jej eksmisji. Wartość domyślna to Usuń. Aby uzyskać więcej informacji na temat eksmisji, zobacz Maszyny wirtualne typu spot
| Wartość |
Opis |
|
Delete
|
Węzły w bazowym zestawie skalowania puli węzłów są usuwane po ich eksmisji.
|
|
Deallocate
|
Węzły w bazowym zestawie skalowania puli węzłów są ustawiane na stan zatrzymania-cofniętego przydziału po eksmisji. Węzły w zatrzymanej liczbie stanu cofania przydziału zasobów obliczeniowych i mogą powodować problemy ze skalowaniem lub uaktualnianiem klastra.
|
ScaleSetPriority
Wyliczenie
Priorytet zestawu skalowania maszyn wirtualnych.
| Wartość |
Opis |
|
Spot
|
Będą używane maszyny wirtualne o priorytecie typu spot. Brak umowy SLA dla węzłów typu spot. Aby uzyskać więcej informacji, zobacz miejscu w usłudze AKS.
|
|
Regular
|
Będą używane zwykłe maszyny wirtualne.
|
SysctlConfig
Sprzeciwiać się
Ustawienia sysctl dla węzłów agenta systemu Linux.
| Nazwa |
Typ |
Opis |
|
fsAioMaxNr
|
integer
(int32)
|
Ustawienie Sysctl fs.aio-max-nr.
|
|
fsFileMax
|
integer
(int32)
|
Ustawienie sysctl fs.file-max.
|
|
fsInotifyMaxUserWatches
|
integer
(int32)
|
Ustawienie sysctl fs.inotify.max_user_watches.
|
|
fsNrOpen
|
integer
(int32)
|
Ustawienie Sysctl fs.nr_open.
|
|
kernelThreadsMax
|
integer
(int32)
|
Ustawienie sysctl kernel.threads-max.
|
|
netCoreNetdevMaxBacklog
|
integer
(int32)
|
Ustawienie Sysctl net.core.netdev_max_backlog.
|
|
netCoreOptmemMax
|
integer
(int32)
|
Ustawienie sysctl net.core.optmem_max.
|
|
netCoreRmemDefault
|
integer
(int32)
|
Ustawienie Sysctl net.core.rmem_default.
|
|
netCoreRmemMax
|
integer
(int32)
|
Ustawienie sysctl net.core.rmem_max.
|
|
netCoreSomaxconn
|
integer
(int32)
|
Ustawienie sysctl net.core.somaxconn.
|
|
netCoreWmemDefault
|
integer
(int32)
|
Ustawienie sysctl net.core.wmem_default.
|
|
netCoreWmemMax
|
integer
(int32)
|
Ustawienie sysctl net.core.wmem_max.
|
|
netIpv4IpLocalPortRange
|
string
|
Ustawienie sysctl net.ipv4.ip_local_port_range.
|
|
netIpv4NeighDefaultGcThresh1
|
integer
(int32)
|
Ustawienie sysctl net.ipv4.neigh.default.gc_thresh1.
|
|
netIpv4NeighDefaultGcThresh2
|
integer
(int32)
|
Ustawienie Sysctl net.ipv4.neigh.default.gc_thresh2.
|
|
netIpv4NeighDefaultGcThresh3
|
integer
(int32)
|
Ustawienie sysctl net.ipv4.neigh.default.gc_thresh3.
|
|
netIpv4TcpFinTimeout
|
integer
(int32)
|
Ustawienie Sysctl net.ipv4.tcp_fin_timeout.
|
|
netIpv4TcpKeepaliveProbes
|
integer
(int32)
|
Ustawienie sysctl net.ipv4.tcp_keepalive_probes.
|
|
netIpv4TcpKeepaliveTime
|
integer
(int32)
|
Ustawienie sysctl net.ipv4.tcp_keepalive_time.
|
|
netIpv4TcpMaxSynBacklog
|
integer
(int32)
|
Ustawienie Sysctl net.ipv4.tcp_max_syn_backlog.
|
|
netIpv4TcpMaxTwBuckets
|
integer
(int32)
|
Ustawienie Sysctl net.ipv4.tcp_max_tw_buckets.
|
|
netIpv4TcpTwReuse
|
boolean
|
Ustawienie Sysctl net.ipv4.tcp_tw_reuse.
|
|
netIpv4TcpkeepaliveIntvl
|
integer
(int32)
minimum: 10 maximum: 90
|
Ustawienie sysctl net.ipv4.tcp_keepalive_intvl.
|
|
netNetfilterNfConntrackBuckets
|
integer
(int32)
minimum: 65536 maximum: 524288
|
Ustawienie sysctl net.netfilter.nf_conntrack_buckets.
|
|
netNetfilterNfConntrackMax
|
integer
(int32)
minimum: 131072 maximum: 2097152
|
Ustawienie sysctl net.netfilter.nf_conntrack_max.
|
|
vmMaxMapCount
|
integer
(int32)
|
Ustawienie sysctl vm.max_map_count.
|
|
vmSwappiness
|
integer
(int32)
|
Ustawienie sysctl vm.swappiness.
|
|
vmVfsCachePressure
|
integer
(int32)
|
Ustawienie Sysctl vm.vfs_cache_pressure.
|
UndrainableNodeBehavior
Wyliczenie
Definiuje zachowanie węzłów niewykonalnych podczas uaktualniania. Najczęstszą przyczyną niedostępnych węzłów jest budżety zakłóceń zasobników (PDB), ale inne problemy, takie jak okres prolongaty zakończenia zasobnika przekracza pozostały limit czasu opróżniania węzła lub zasobnik jest nadal w stanie uruchomienia, może również spowodować niezrównowadzone węzły.
| Wartość |
Opis |
|
Schedule
|
Usługa AKS oznaczy zablokowane węzły jako możliwe do zaplanowania, ale zablokowane węzły nie zostaną uaktualnione. Zostanie podjęta próba usunięcia wszystkich węzłów przepięcia. Operacja uaktualniania i klaster zarządzany będą w stanie niepowodzenia, jeśli istnieją zablokowane węzły.
|
|
Cordon
|
Usługa AKS zabezpieczy zablokowane węzły i zastąpi je węzłami przepięcia podczas uaktualniania. Zablokowane węzły zostaną kordonowane i zastąpione węzłami przepięcia. Zablokowane węzły będą miały etykietę "kubernetes.azure.com/upgrade-status:Quarantined". Węzeł przepięcia zostanie zachowany dla każdego zablokowanego węzła. Zostanie podjęta próba usunięcia wszystkich innych węzłów przepięcia. Jeśli istnieje wystarczająca liczba węzłów przepięcia, aby zastąpić zablokowane węzły, operacja uaktualniania i klaster zarządzany będą w stanie niepowodzenia. W przeciwnym razie operacja uaktualniania i zarządzany klaster będą w stanie anulowania.
|
VirtualMachineNodes
Sprzeciwiać się
Bieżący stan w grupie węzłów o tym samym rozmiarze maszyny wirtualnej.
| Nazwa |
Typ |
Opis |
|
count
|
integer
(int32)
|
Liczba węzłów.
|
|
size
|
string
|
Rozmiar maszyny wirtualnej agentów używanych do hostowania tej grupy węzłów.
|
VirtualMachinesProfile
Sprzeciwiać się
Specyfikacje w puli agentów VirtualMachines.
| Nazwa |
Typ |
Opis |
|
scale
|
ScaleProfile
|
Specyfikacje dotyczące skalowania puli agentów VirtualMachines.
|
WorkloadRuntime
Wyliczenie
Określa typ obciążenia, który może uruchomić węzeł.
| Wartość |
Opis |
|
OCIContainer
|
Węzły będą używać rozwiązania Kubelet do uruchamiania standardowych obciążeń kontenerów OCI.
|
|
WasmWasi
|
Węzły będą używać narzędzia Krustlet do uruchamiania obciążeń WASM przy użyciu dostawcy WASI (wersja zapoznawcza).
|
|
KataVmIsolation
|
Węzły mogą używać (Kata + Cloud Hypervisor + Hyper-V) do włączania zagnieżdżonych zasobników opartych na maszynach wirtualnych. Ze względu na użycie funkcji Hyper-V sam system operacyjny węzła usługi AKS jest zagnieżdżonym maszyną wirtualną (głównym systemem operacyjnym) funkcji Hyper-V. W związku z tym można go używać tylko z serii maszyn wirtualnych, które obsługują wirtualizację zagnieżdżona, taką jak seria Dv3.
|