Tworzy lub aktualizuje klaster zarządzany.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}?api-version=2026-06-01
Parametry identyfikatora URI
| Nazwa |
W |
Wymagane |
Typ |
Opis |
|
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.
|
Treść żądania
| Nazwa |
Wymagane |
Typ |
Opis |
|
location
|
True
|
string
|
Lokalizacja geograficzna, w której znajduje się zasób
|
|
extendedLocation
|
|
ExtendedLocation
|
Rozszerzona lokalizacja maszyny wirtualnej.
|
|
identity
|
|
ManagedClusterIdentity
|
Tożsamość klastra zarządzanego, jeśli jest skonfigurowana.
|
|
kind
|
|
string
|
Jest to używane głównie do uwidaczniania różnych środowisk interfejsu użytkownika w portalu dla różnych rodzajów
|
|
properties.aadProfile
|
|
ManagedClusterAADProfile
|
Konfiguracja Azure Active Directory.
|
|
properties.addonProfiles
|
|
<string,
ManagedClusterAddonProfile>
|
Profil dodatku klastra zarządzanego.
|
|
properties.agentPoolProfiles
|
|
ManagedClusterAgentPoolProfile[]
|
Właściwości puli agentów.
|
|
properties.aiToolchainOperatorProfile
|
|
ManagedClusterAIToolchainOperatorProfile
|
Ustawienia operatora łańcucha narzędzi sztucznej inteligencji, które mają zastosowanie do całego klastra.
|
|
properties.apiServerAccessProfile
|
|
ManagedClusterAPIServerAccessProfile
|
Profil access dla zarządzanego serwera API klastra.
|
|
properties.autoScalerProfile
|
|
ManagedClusterPropertiesAutoScalerProfile
|
Parametry, które mają być stosowane do skalowania automatycznego klastra po włączeniu
|
|
properties.autoUpgradeProfile
|
|
ManagedClusterAutoUpgradeProfile
|
Konfiguracja automatycznego uaktualniania.
|
|
properties.azureMonitorProfile
|
|
ManagedClusterAzureMonitorProfile
|
Profile dodatków Azure Monitor do monitorowania zarządzanego klastra.
|
|
properties.bootstrapProfile
|
|
ManagedClusterBootstrapProfile
|
Profil konfiguracji uruchamiania klastra.
|
|
properties.disableLocalAccounts
|
|
boolean
|
Jeśli konta lokalne powinny być wyłączone w klastrze zarządzanym. Jeśli ustawiono wartość true, pobieranie poświadczeń statycznych zostanie wyłączone dla tego klastra. Należy go używać tylko w klastrach zarządzanych z włączoną usługą AAD. Więcej szczegółów można znaleźć w wyłącz konta lokalne.
|
|
properties.diskEncryptionSetID
|
|
string
(arm-id)
|
Identyfikator zasobu szyfrowania dysku ustawiony na potrzeby włączania szyfrowania magazynowanych. Jest to forma: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}"
|
|
properties.dnsPrefix
|
|
string
|
Prefiks DNS klastra zarządzanego. Nie można go zaktualizować po utworzeniu klastra zarządzanego.
|
|
properties.enableRBAC
|
|
boolean
|
Czy włączyć Kubernetes Role-Based Access Control.
|
|
properties.fqdnSubdomain
|
|
string
|
Poddomena nazwy FQDN klastra prywatnego z niestandardową prywatną strefą DNS. Nie można go zaktualizować po utworzeniu klastra zarządzanego.
|
|
properties.hostedSystemProfile
|
|
ManagedClusterHostedSystemProfile
|
Ustawienia hostowanych dodatków systemowych. Aby uzyskać więcej informacji, zobacz https://aka.ms/aks/automatic/systemcomponents.
|
|
properties.httpProxyConfig
|
|
ManagedClusterHTTPProxyConfig
|
Konfiguracje aprowizowania klastra za pomocą serwerów proxy HTTP.
|
|
properties.identityProfile
|
|
<string,
UserAssignedIdentity>
|
Tożsamość użytkownika skojarzona z klastrem zarządzanym. Ta tożsamość będzie używana przez narzędzie kubelet. Dozwolona jest tylko jedna tożsamość przypisana przez użytkownika. Jedynym akceptowanym kluczem jest "kubeletidentity", z wartością "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".
|
|
properties.ingressProfile
|
|
ManagedClusterIngressProfile
|
Profil ruchu przychodzącego dla klastra zarządzanego.
|
|
properties.kubernetesVersion
|
|
string
|
Wersja platformy Kubernetes określona przez użytkownika. Obsługiwane są obie wersje poprawki <major.minor.patch> (np. 1.20.13) i <główna.pomocnicza> (np. 1.20). Po <określeniu wersji major.minor> jest wybierana automatycznie najnowsza obsługiwana wersja poprawki ogólnie dostępnej. Aktualizacja klastra o tej samej <wersji głównej.pomocnicza> po utworzeniu klastra (np. 1.14.x –> 1.14) nie spowoduje wyzwolenia uaktualnienia, nawet jeśli jest dostępna nowsza wersja poprawki. Podczas uaktualniania obsługiwanego klastra usługi AKS nie można pominąć wersji pomocniczych platformy Kubernetes. Wszystkie uaktualnienia muszą zostać wykonane w kolejności według numeru wersji głównej. Na przykład uaktualnienia z zakresu 1.14.x —> 1.15.x lub 1.15.x —> 1.16.x są dozwolone, jednak wersja 1.14.x —> 1.16.x jest niedozwolona. Zobacz ulepszenie klastra AKS po więcej szczegółów.
|
|
properties.linuxProfile
|
|
ContainerServiceLinuxProfile
|
Profil maszyn wirtualnych z systemem Linux w klastrze zarządzanym.
|
|
properties.metricsProfile
|
|
ManagedClusterMetricsProfile
|
Opcjonalna konfiguracja metryk klastra.
|
|
properties.networkProfile
|
|
ContainerServiceNetworkProfile
|
Profil konfiguracji sieci.
|
|
properties.nodeProvisioningProfile
|
|
ManagedClusterNodeProvisioningProfile
|
Ustawienia aprowizacji węzła, które mają zastosowanie do całego klastra.
|
|
properties.nodeResourceGroup
|
|
string
|
Nazwa grupy zasobów zawierającej węzły puli agentów.
|
|
properties.nodeResourceGroupProfile
|
|
ManagedClusterNodeResourceGroupProfile
|
Profil konfiguracji grupy zasobów węzła.
|
|
properties.oidcIssuerProfile
|
|
ManagedClusterOIDCIssuerProfile
|
Profil wystawcy OIDC klastra zarządzanego.
|
|
properties.podIdentityProfile
|
|
ManagedClusterPodIdentityProfile
|
Profil tożsamości zasobnika klastra zarządzanego. Zobacz use AAD pod identity aby uzyskać więcej szczegółów na temat integracji z tożsamością AAD.
|
|
properties.privateLinkResources
|
|
PrivateLinkResource[]
|
Private link zasobów powiązanych z klastrem.
|
|
properties.publicNetworkAccess
|
|
PublicNetworkAccess
|
PublicNetworkAccess klastra zarządzanego. Zezwalaj lub odmawiaj access do sieci publicznej dla AKS
|
|
properties.schedulerProfile
|
|
SchedulerProfile
|
Profil z ustawieniami związanymi z harmonogramem, takimi jak tryb konfiguracji dla każdego planisty zarządzany przez AKS. Zobacz: https://aka.ms/aks/scheduler-profile.
|
|
properties.securityProfile
|
|
ManagedClusterSecurityProfile
|
Profil zabezpieczeń klastra zarządzanego.
|
|
properties.serviceMeshProfile
|
|
ServiceMeshProfile
|
Profil usługi Service Mesh dla klastra zarządzanego.
|
|
properties.servicePrincipalProfile
|
|
ManagedClusterServicePrincipalProfile
|
Informacje o tożsamości głównej usługi dla klastra do manipulacji API Azure.
|
|
properties.status
|
|
ManagedClusterStatus
|
Zawiera informacje tylko do odczytu dotyczące klastra zarządzanego.
|
|
properties.storageProfile
|
|
ManagedClusterStorageProfile
|
Storage profile dla zarządzanego klastra.
|
|
properties.supportPlan
|
|
KubernetesSupportPlan
|
Plan pomocy technicznej dla klastra zarządzanego. Jeśli nie określono, wartość domyślna to "KubernetesOfficial".
|
|
properties.upgradeSettings
|
|
ClusterUpgradeSettings
|
Ustawienia uaktualniania klastra.
|
|
properties.windowsProfile
|
|
ManagedClusterWindowsProfile
|
Profil maszyn wirtualnych z systemem Windows w klastrze zarządzanym.
|
|
properties.workloadAutoScalerProfile
|
|
ManagedClusterWorkloadAutoScalerProfile
|
Profil automatycznego skalowania obciążenia dla klastra zarządzanego.
|
|
sku
|
|
ManagedClusterSKU
|
Jednostka SKU klastra zarządzanego.
|
|
tags
|
|
object
|
Tagi zasobów.
|
Odpowiedzi
| Nazwa |
Typ |
Opis |
|
200 OK
|
ManagedCluster
|
Operacja aktualizacji zasobu "ManagedCluster" powiodła się
|
|
201 Created
|
ManagedCluster
|
Operacja tworzenia zasobu 'ManagedCluster' zakończyła się sukcesem
Nagłówki
- Azure-AsyncOperation: string
- Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
Nieoczekiwana odpowiedź na błąd.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 w usłudze Azure Active Directory.
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
| Nazwa |
Opis |
|
user_impersonation
|
podszywaj się pod konto użytkownika
|
Przykłady
Create Managed Cluster using an agent pool snapshot
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"enableFIPS": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.CreationData;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Snapshot.json
*/
/**
* Sample code: Create Managed Cluster using an agent pool snapshot.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterUsingAnAgentPoolSnapshot(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableFips(true)
.withCreationData(new CreationData().withSourceResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"))
.withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_snapshot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"enableFIPS": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_Snapshot.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_Snapshot.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAnAgentPoolSnapshot() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
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),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// 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.9.6"),
// EnableFIPS: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Snapshot.json
*/
async function createManagedClusterUsingAnAgentPoolSnapshot() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
creationData: {
sourceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1",
},
enableFips: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"currentOrchestratorVersion": "1.9.6",
"enableFIPS": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"currentOrchestratorVersion": "1.9.6",
"enableFIPS": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Advanced Networking Transit Encryption
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"advancedNetworking": {
"enabled": true,
"observability": {
"enabled": false
},
"security": {
"advancedNetworkPolicies": "FQDN",
"enabled": true,
"transitEncryption": {
"type": "WireGuard"
}
}
},
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkDataplane": "cilium",
"networkPlugin": "azure",
"networkPluginMode": "overlay",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AdvancedNetworkPolicies;
import com.azure.resourcemanager.containerservice.models.AdvancedNetworking;
import com.azure.resourcemanager.containerservice.models.AdvancedNetworkingObservability;
import com.azure.resourcemanager.containerservice.models.AdvancedNetworkingSecurity;
import com.azure.resourcemanager.containerservice.models.AdvancedNetworkingSecurityTransitEncryption;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.NetworkDataplane;
import com.azure.resourcemanager.containerservice.models.NetworkPlugin;
import com.azure.resourcemanager.containerservice.models.NetworkPluginMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.TransitEncryptionType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/AdvancedNetworkingTransitEncryption.json
*/
/**
* Sample code: Create Managed Cluster with Advanced Networking Transit Encryption.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithAdvancedNetworkingTransitEncryption(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withNetworkPlugin(NetworkPlugin.AZURE)
.withNetworkPluginMode(NetworkPluginMode.OVERLAY).withNetworkDataplane(NetworkDataplane.CILIUM)
.withAdvancedNetworking(new AdvancedNetworking().withEnabled(true)
.withObservability(new AdvancedNetworkingObservability().withEnabled(false))
.withSecurity(new AdvancedNetworkingSecurity().withEnabled(true)
.withAdvancedNetworkPolicies(AdvancedNetworkPolicies.FQDN)
.withTransitEncryption(new AdvancedNetworkingSecurityTransitEncryption()
.withType(TransitEncryptionType.WIRE_GUARD))))
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile().withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python advanced_networking_transit_encryption.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"advancedNetworking": {
"enabled": True,
"observability": {"enabled": False},
"security": {
"advancedNetworkPolicies": "FQDN",
"enabled": True,
"transitEncryption": {"type": "WireGuard"},
},
},
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"networkDataplane": "cilium",
"networkPlugin": "azure",
"networkPluginMode": "overlay",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/AdvancedNetworkingTransitEncryption.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/AdvancedNetworkingTransitEncryption.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAdvancedNetworkingTransitEncryption() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
AdvancedNetworking: &armcontainerservice.AdvancedNetworking{
Enabled: to.Ptr(true),
Observability: &armcontainerservice.AdvancedNetworkingObservability{
Enabled: to.Ptr(false),
},
Security: &armcontainerservice.AdvancedNetworkingSecurity{
AdvancedNetworkPolicies: to.Ptr(armcontainerservice.AdvancedNetworkPoliciesFQDN),
Enabled: to.Ptr(true),
TransitEncryption: &armcontainerservice.AdvancedNetworkingSecurityTransitEncryption{
Type: to.Ptr(armcontainerservice.TransitEncryptionTypeWireGuard),
},
},
},
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium),
NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure),
NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// AdvancedNetworking: &armcontainerservice.AdvancedNetworking{
// Enabled: to.Ptr(true),
// Observability: &armcontainerservice.AdvancedNetworkingObservability{
// Enabled: to.Ptr(false),
// },
// Security: &armcontainerservice.AdvancedNetworkingSecurity{
// AdvancedNetworkPolicies: to.Ptr(armcontainerservice.AdvancedNetworkPoliciesFQDN),
// Enabled: to.Ptr(true),
// TransitEncryption: &armcontainerservice.AdvancedNetworkingSecurityTransitEncryption{
// Type: to.Ptr(armcontainerservice.TransitEncryptionTypeWireGuard),
// },
// },
// },
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
// NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure),
// NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/AdvancedNetworkingTransitEncryption.json
*/
async function createManagedClusterWithAdvancedNetworkingTransitEncryption() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
advancedNetworking: {
enabled: true,
observability: { enabled: false },
security: {
advancedNetworkPolicies: "FQDN",
enabled: true,
transitEncryption: { type: "WireGuard" },
},
},
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
networkDataplane: "cilium",
networkPlugin: "azure",
networkPluginMode: "overlay",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"advancedNetworking": {
"enabled": true,
"observability": {
"enabled": false
},
"security": {
"advancedNetworkPolicies": "FQDN",
"enabled": true,
"transitEncryption": {
"type": "WireGuard"
}
}
},
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkDataplane": "cilium",
"networkPlugin": "azure",
"networkPluginMode": "overlay",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"advancedNetworking": {
"enabled": true,
"observability": {
"enabled": false
},
"security": {
"advancedNetworkPolicies": "FQDN",
"enabled": true,
"transitEncryption": {
"type": "WireGuard"
}
}
},
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkDataplane": "cilium",
"networkPlugin": "azure",
"networkPluginMode": "overlay",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with AKS-managed NAT gateway as outbound type
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": false,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerSku": "standard",
"natGatewayProfile": {
"managedOutboundIPProfile": {
"count": 2
}
},
"outboundType": "managedNATGateway"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterManagedOutboundIpProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterNatGatewayProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_ManagedNATGateway.json
*/
/**
* Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(false).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.MANAGED_NATGATEWAY).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withNatGatewayProfile(new ManagedClusterNatGatewayProfile()
.withManagedOutboundIpProfile(new ManagedClusterManagedOutboundIpProfile().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_managed_nat_gateway.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": False,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerSku": "standard",
"natGatewayProfile": {"managedOutboundIPProfile": {"count": 2}},
"outboundType": "managedNATGateway",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_ManagedNATGateway.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_ManagedNATGateway.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAksManagedNatGatewayAsOutboundType() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(false),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
NatGatewayProfile: &armcontainerservice.ManagedClusterNATGatewayProfile{
ManagedOutboundIPProfile: &armcontainerservice.ManagedClusterManagedOutboundIPProfile{
Count: to.Ptr[int32](2),
},
},
OutboundType: to.Ptr(armcontainerservice.OutboundTypeManagedNATGateway),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(false),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NatGatewayProfile: &armcontainerservice.ManagedClusterNATGatewayProfile{
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](4),
// ManagedOutboundIPProfile: &armcontainerservice.ManagedClusterManagedOutboundIPProfile{
// Count: to.Ptr[int32](2),
// },
// },
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeManagedNATGateway),
// PodCidr: to.Ptr("10.244.0.0/16"),
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_ManagedNATGateway.json
*/
async function createManagedClusterWithAKSManagedNATGatewayAsOutboundType() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: false,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerSku: "standard",
natGatewayProfile: { managedOutboundIPProfile: { count: 2 } },
outboundType: "managedNATGateway",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": false,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerSku": "basic",
"natGatewayProfile": {
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 4,
"managedOutboundIPProfile": {
"count": 2
}
},
"networkPlugin": "kubenet",
"outboundType": "managedNATGateway",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": false,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerSku": "standard",
"natGatewayProfile": {
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 4,
"managedOutboundIPProfile": {
"count": 2
}
},
"networkPlugin": "kubenet",
"outboundType": "managedNATGateway",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Azure KeyVault Secrets Provider Addon
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAddonProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json
*/
/**
* Sample code: Create Managed Cluster with Azure KeyVault Secrets Provider Addon.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithAzureKeyVaultSecretsProviderAddon(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile().withClientId("clientid")
.withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf("azureKeyvaultSecretsProvider",
new ManagedClusterAddonProfile().withEnabled(true).withConfig(
mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m"))))
.withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_azure_keyvault_secrets_provider.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {"enableSecretRotation": "true", "rotationPollInterval": "2m"},
"enabled": True,
}
},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAzureKeyVaultSecretsProviderAddon() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{
"azureKeyvaultSecretsProvider": {
Config: map[string]*string{
"enableSecretRotation": to.Ptr("true"),
"rotationPollInterval": to.Ptr("2m"),
},
Enabled: to.Ptr(true),
},
},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{
// "azureKeyvaultSecretsProvider": &armcontainerservice.ManagedClusterAddonProfile{
// Config: map[string]*string{
// "enableSecretRotation": to.Ptr("true"),
// "rotationPollInterval": to.Ptr("2m"),
// },
// Enabled: to.Ptr(true),
// },
// },
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json
*/
async function createManagedClusterWithAzureKeyVaultSecretsProviderAddon() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {
azureKeyvaultSecretsProvider: {
config: { enableSecretRotation: "true", rotationPollInterval: "2m" },
enabled: true,
},
},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Capacity Reservation Group
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_CRG.json
*/
/**
* Sample code: Create Managed Cluster with Capacity Reservation Group.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithCapacityReservationGroup(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true)
.withCapacityReservationGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1")
.withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_crg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1",
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_CRG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_CRG.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCapacityReservationGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// 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"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_CRG.json
*/
async function createManagedClusterWithCapacityReservationGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
capacityReservationGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Custom CA Trust Certificates
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"securityProfile": {
"customCATrustCertificates": [
"ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="
]
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_CustomCATrustCertificates.json
*/
/**
* Sample code: Create Managed Cluster with Custom CA Trust Certificates.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithCustomCATrustCertificates(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.withSecurityProfile(new ManagedClusterSecurityProfile().withCustomCATrustCertificates(
Arrays.asList("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=".getBytes()))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_custom_ca_trust_certificates.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"securityProfile": {
"customCATrustCertificates": ["ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="]
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_CustomCATrustCertificates.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_CustomCATrustCertificates.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCustomCaTrustCertificates() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{
CustomCATrustCertificates: [][]byte{
[]byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="),
},
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{
// CustomCATrustCertificates: [][]byte{
// []byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="),
// },
// },
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_CustomCATrustCertificates.json
*/
async function createManagedClusterWithCustomCATrustCertificates() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
securityProfile: {
customCATrustCertificates: [
Buffer.from("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=", "base64"),
],
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"securityProfile": {
"customCATrustCertificates": [
"ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="
]
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"securityProfile": {
"customCATrustCertificates": [
"ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="
]
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Dedicated Host Group
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DedicatedHostGroup.json
*/
/**
* Sample code: Create Managed Cluster with Dedicated Host Group.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithDedicatedHostGroup(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withEnableNodePublicIp(true)
.withHostGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1")
.withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_dedicated_host_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_DedicatedHostGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_DedicatedHostGroup.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDedicatedHostGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// EnableNodePublicIP: to.Ptr(true),
// HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
// MaxPods: to.Ptr[int32](110),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DedicatedHostGroup.json
*/
async function createManagedClusterWithDedicatedHostGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
hostGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"maxPods": 110,
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"maxPods": 110,
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with EncryptionAtHost enabled
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableEncryptionAtHost.json
*/
/**
* Sample code: Create Managed Cluster with EncryptionAtHost enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithEncryptionAtHostEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableEncryptionAtHost(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_enable_encryption_at_host.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableEncryptionAtHost.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_EnableEncryptionAtHost.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEncryptionAtHostEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableEncryptionAtHost.json
*/
async function createManagedClusterWithEncryptionAtHostEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with FIPS enabled OS
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableFIPS": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnabledFIPS.json
*/
/**
* Sample code: Create Managed Cluster with FIPS enabled OS.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithFIPSEnabledOS(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableFips(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_enabled_fips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableFIPS": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnabledFIPS.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_EnabledFIPS.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFipsEnabledOS() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableFIPS: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableFIPS: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnabledFIPS.json
*/
async function createManagedClusterWithFipsEnabledOS() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableFips: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableFIPS": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableFIPS": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with GPUMIG
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"gpuInstanceProfile": "MIG3g",
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_ND96asr_v4"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.GpuInstanceProfile;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterHttpProxyConfig;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_GPUMIG.json
*/
/**
* Sample code: Create Managed Cluster with GPUMIG.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createManagedClusterWithGPUMIG(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_ND96asr_v4").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withGpuInstanceProfile(GpuInstanceProfile.MIG3G).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080")
.withHttpsProxy("https://myproxy.server.com:8080").withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
.withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_gpumig.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"gpuInstanceProfile": "MIG3g",
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_ND96asr_v4",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": ["localhost", "127.0.0.1"],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_GPUMIG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_GPUMIG.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGpumig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG3G),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_ND96asr_v4"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
NoProxy: []*string{
to.Ptr("localhost"),
to.Ptr("127.0.0.1"),
},
TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
},
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG3G),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_ND96asr_v4"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
// HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
// HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
// NoProxy: []*string{
// to.Ptr("localhost"),
// to.Ptr("127.0.0.1"),
// },
// TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
// },
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_GPUMIG.json
*/
async function createManagedClusterWithGpumig() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
gpuInstanceProfile: "MIG3g",
mode: "System",
osType: "Linux",
vmSize: "Standard_ND96asr_v4",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
httpProxyConfig: {
httpProxy: "http://myproxy.server.com:8080",
httpsProxy: "https://myproxy.server.com:8080",
noProxy: ["localhost", "127.0.0.1"],
trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"gpuInstanceProfile": "MIG3g",
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_ND96asr_v4"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"gpuInstanceProfile": "MIG3g",
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_ND96asr_v4"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterHttpProxyConfig;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_HTTPProxy.json
*/
/**
* Sample code: Create Managed Cluster with HTTP proxy configured.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithHTTPProxyConfigured(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080")
.withHttpsProxy("https://myproxy.server.com:8080")
.withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
.withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_httpproxy.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": ["localhost", "127.0.0.1"],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_HTTPProxy.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_HTTPProxy.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHttpProxyConfigured() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
NoProxy: []*string{
to.Ptr("localhost"),
to.Ptr("127.0.0.1"),
},
TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
},
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
// HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
// HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
// NoProxy: []*string{
// to.Ptr("localhost"),
// to.Ptr("127.0.0.1"),
// },
// TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
// },
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_HTTPProxy.json
*/
async function createManagedClusterWithHttpProxyConfigured() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
httpProxyConfig: {
httpProxy: "http://myproxy.server.com:8080",
httpsProxy: "https://myproxy.server.com:8080",
noProxy: ["localhost", "127.0.0.1"],
trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with LongTermSupport
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"supportPlan": "AKSLongTermSupport",
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Base",
"tier": "Premium"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.KubernetesSupportPlan;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Premium.json
*/
/**
* Sample code: Create Managed Cluster with LongTermSupport.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithLongTermSupport(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(
new ManagedClusterSku().withName(ManagedClusterSkuName.BASE).withTier(ManagedClusterSkuTier.PREMIUM))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(
new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableEncryptionAtHost(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true).withSupportPlan(KubernetesSupportPlan.AKSLONG_TERM_SUPPORT)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)), null,
null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_premium.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"apiServerAccessProfile": {"disableRunCommand": True},
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"supportPlan": "AKSLongTermSupport",
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Base", "tier": "Premium"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_Premium.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_Premium.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLongTermSupport() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
DisableRunCommand: to.Ptr(true),
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport),
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
// DisableRunCommand: to.Ptr(true),
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport),
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// SKU: &armcontainerservice.ManagedClusterSKU{
// Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase),
// Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium),
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Premium.json
*/
async function createManagedClusterWithLongTermSupport() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
apiServerAccessProfile: { disableRunCommand: true },
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
supportPlan: "AKSLongTermSupport",
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Base", tier: "Premium" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"supportPlan": "AKSLongTermSupport",
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Base",
"tier": "Premium"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"supportPlan": "AKSLongTermSupport",
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Base",
"tier": "Premium"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with Node Public IP Prefix
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"nodePublicIPPrefixID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_NodePublicIPPrefix.json
*/
/**
* Sample code: Create Managed Cluster with Node Public IP Prefix.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithNodePublicIPPrefix(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true)
.withNodePublicIpPrefixId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix")
.withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_node_public_ip_prefix.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"nodePublicIPPrefixID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_NodePublicIPPrefix.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_NodePublicIPPrefix.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodePublicIPPrefix() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
NodePublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// NodePublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_NodePublicIPPrefix.json
*/
async function createManagedClusterWithNodePublicIPPrefix() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
nodePublicIPPrefixID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"nodePublicIPPrefixID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodePublicIPPrefixID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with OSSKU
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osSKU": "AzureLinux",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterHttpProxyConfig;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_OSSKU.json
*/
/**
* Sample code: Create Managed Cluster with OSSKU.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createManagedClusterWithOSSKU(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOsSku(OSSku.AZURE_LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.withHttpProxyConfig(new ManagedClusterHttpProxyConfig().withHttpProxy("http://myproxy.server.com:8080")
.withHttpsProxy("https://myproxy.server.com:8080")
.withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
.withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_ossku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osSKU": "AzureLinux",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": ["localhost", "127.0.0.1"],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_OSSKU.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_OSSKU.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOssku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
NoProxy: []*string{
to.Ptr("localhost"),
to.Ptr("127.0.0.1"),
},
TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
},
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{
// HTTPProxy: to.Ptr("http://myproxy.server.com:8080"),
// HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"),
// NoProxy: []*string{
// to.Ptr("localhost"),
// to.Ptr("127.0.0.1"),
// },
// TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="),
// },
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_OSSKU.json
*/
async function createManagedClusterWithOssku() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osSKU: "AzureLinux",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
httpProxyConfig: {
httpProxy: "http://myproxy.server.com:8080",
httpsProxy: "https://myproxy.server.com:8080",
noProxy: ["localhost", "127.0.0.1"],
trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=",
},
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osSKU": "AzureLinux",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osSKU": "AzureLinux",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"httpProxyConfig": {
"httpProxy": "http://myproxy.server.com:8080",
"httpsProxy": "https://myproxy.server.com:8080",
"noProxy": [
"localhost",
"127.0.0.1"
],
"trustedCa": "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with PodIdentity enabled
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"podIdentityProfile": {
"allowNetworkPluginKubenet": true,
"enabled": true
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPodIdentityProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PodIdentity.json
*/
/**
* Sample code: Create Managed Cluster with PodIdentity enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithPodIdentityEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile().withClientId("clientid")
.withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf())
.withPodIdentityProfile(
new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true))
.withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_pod_identity.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"podIdentityProfile": {"allowNetworkPluginKubenet": True, "enabled": True},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_PodIdentity.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_PodIdentity.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPodIdentityEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
PodIdentityProfile: &armcontainerservice.ManagedClusterPodIdentityProfile{
AllowNetworkPluginKubenet: to.Ptr(true),
Enabled: to.Ptr(true),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// PodIdentityProfile: &armcontainerservice.ManagedClusterPodIdentityProfile{
// AllowNetworkPluginKubenet: to.Ptr(true),
// Enabled: to.Ptr(true),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PodIdentity.json
*/
async function createManagedClusterWithPodIdentityEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
podIdentityProfile: { allowNetworkPluginKubenet: true, enabled: true },
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"podIdentityProfile": {
"allowNetworkPluginKubenet": true,
"enabled": true
},
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"podIdentityProfile": {
"allowNetworkPluginKubenet": true,
"enabled": true
},
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with PPG
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PPG.json
*/
/**
* Sample code: Create Managed Cluster with PPG.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createManagedClusterWithPPG(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true)
.withProximityPlacementGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1")
.withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_ppg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_PPG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_PPG.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPpg() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
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"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// 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"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PPG.json
*/
async function createManagedClusterWithPPG() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
proximityPlacementGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with RunCommand disabled
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DisableRunCommand.json
*/
/**
* Sample code: Create Managed Cluster with RunCommand disabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithRunCommandDisabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableEncryptionAtHost(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile().withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_disable_run_command.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"apiServerAccessProfile": {"disableRunCommand": True},
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_DisableRunCommand.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_DisableRunCommand.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRunCommandDisabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
DisableRunCommand: to.Ptr(true),
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
// DisableRunCommand: to.Ptr(true),
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial),
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DisableRunCommand.json
*/
async function createManagedClusterWithRunCommandDisabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
apiServerAccessProfile: { disableRunCommand: true },
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"supportPlan": "KubernetesOfficial",
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"disableRunCommand": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"supportPlan": "KubernetesOfficial",
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"dnsPrefix": "dnsprefix1",
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"securityProfile": {
"defender": {
"logAnalyticsWorkspaceResourceId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME",
"securityMonitoring": {
"enabled": true
}
},
"workloadIdentity": {
"enabled": true
}
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfileDefender;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_SecurityProfile.json
*/
/**
* Sample code: Create Managed Cluster with Security Profile configured.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithSecurityProfileConfigured(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withSecurityProfile(new ManagedClusterSecurityProfile()
.withDefender(new ManagedClusterSecurityProfileDefender().withLogAnalyticsWorkspaceResourceId(
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME")
.withSecurityMonitoring(
new ManagedClusterSecurityProfileDefenderSecurityMonitoring().withEnabled(true)))
.withWorkloadIdentity(new ManagedClusterSecurityProfileWorkloadIdentity().withEnabled(true))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_security_profile.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"dnsPrefix": "dnsprefix1",
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"securityProfile": {
"defender": {
"logAnalyticsWorkspaceResourceId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME",
"securityMonitoring": {"enabled": True},
},
"workloadIdentity": {"enabled": True},
},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_SecurityProfile.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_SecurityProfile.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSecurityProfileConfigured() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
DNSPrefix: to.Ptr("dnsprefix1"),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{
Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{
LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"),
SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{
Enabled: to.Ptr(true),
},
},
WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{
Enabled: to.Ptr(true),
},
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{
// Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{
// LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"),
// SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{
// Enabled: to.Ptr(true),
// },
// },
// WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{
// Enabled: to.Ptr(true),
// },
// },
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_SecurityProfile.json
*/
async function createManagedClusterWithSecurityProfileConfigured() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
dnsPrefix: "dnsprefix1",
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
securityProfile: {
defender: {
logAnalyticsWorkspaceResourceId:
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME",
securityMonitoring: { enabled: true },
},
workloadIdentity: { enabled: true },
},
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"securityProfile": {
"defender": {
"logAnalyticsWorkspaceResourceId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME",
"securityMonitoring": {
"enabled": true
}
},
"workloadIdentity": {
"enabled": true
}
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"securityProfile": {
"defender": {
"logAnalyticsWorkspaceResourceId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME",
"securityMonitoring": {
"enabled": true
}
},
"workloadIdentity": {
"enabled": true
}
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with UltraSSD enabled
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"enableUltraSSD": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableUltraSSD.json
*/
/**
* Sample code: Create Managed Cluster with UltraSSD enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithUltraSSDEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableUltraSsd(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_enable_ultra_ssd.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"enableUltraSSD": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableUltraSSD.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_EnableUltraSSD.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
EnableUltraSSD: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// EnableUltraSSD: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_EnableUltraSSD.json
*/
async function createManagedClusterWithUltraSSDEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
enableUltraSSD: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"enableUltraSSD": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"enableUltraSSD": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Cluster with user-assigned NAT gateway as outbound type
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": false,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerSku": "standard",
"outboundType": "userAssignedNATGateway"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UserAssignedNATGateway.json
*/
/**
* Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(false).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY)
.withLoadBalancerSku(LoadBalancerSku.STANDARD))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_user_assigned_nat_gateway.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": False,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {"loadBalancerSku": "standard", "outboundType": "userAssignedNATGateway"},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_UserAssignedNATGateway.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_UserAssignedNATGateway.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUserAssignedNatGatewayAsOutboundType() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(false),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeUserAssignedNATGateway),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(false),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeUserAssignedNATGateway),
// PodCidr: to.Ptr("10.244.0.0/16"),
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UserAssignedNATGateway.json
*/
async function createManagedClusterWithUserAssignedNATGatewayAsOutboundType() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: false,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: { loadBalancerSku: "standard", outboundType: "userAssignedNATGateway" },
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": false,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "userAssignedNATGateway",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": false,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "userAssignedNATGateway",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"dnsPrefix": "dnsprefix1",
"ingressProfile": {
"webAppRouting": {
"dnsZoneResourceIds": [
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"
],
"enabled": true
}
},
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIngressProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIngressProfileWebAppRouting;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json
*/
/**
* Sample code: Create Managed Cluster with Web App Routing Ingress Profile configured.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedClusterWithWebAppRoutingIngressProfileConfigured(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withIngressProfile(new ManagedClusterIngressProfile()
.withWebAppRouting(new ManagedClusterIngressProfileWebAppRouting().withEnabled(true)
.withDnsZoneResourceIds(Arrays.asList(
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME")))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_ingress_profile_web_app_routing.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"dnsPrefix": "dnsprefix1",
"ingressProfile": {
"webAppRouting": {
"dnsZoneResourceIds": [
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"
],
"enabled": True,
}
},
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWebAppRoutingIngressProfileConfigured() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
DNSPrefix: to.Ptr("dnsprefix1"),
IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{
WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{
DNSZoneResourceIDs: []*string{
to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"),
},
Enabled: to.Ptr(true),
},
},
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{
// WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{
// DNSZoneResourceIDs: []*string{
// to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"),
// },
// Enabled: to.Ptr(true),
// },
// },
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_IngressProfile_WebAppRouting.json
*/
async function createManagedClusterWithWebAppRoutingIngressProfileConfigured() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
dnsPrefix: "dnsprefix1",
ingressProfile: {
webAppRouting: {
dnsZoneResourceIds: [
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME",
],
enabled: true,
},
},
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"ingressProfile": {
"webAppRouting": {
"dnsZoneResourceIds": [
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"
],
"enabled": true
}
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"ingressProfile": {
"webAppRouting": {
"dnsZoneResourceIds": [
"/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"
],
"enabled": true
}
},
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Private Cluster with fqdn subdomain specified
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"privateDNSZone": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"enableRBAC": true,
"fqdnSubdomain": "domain1",
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
*/
/**
* Sample code: Create Managed Private Cluster with fqdn subdomain specified.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedPrivateClusterWithFqdnSubdomainSpecified(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withFqdnSubdomain("domain1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableEncryptionAtHost(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withApiServerAccessProfile(
new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true).withPrivateDnsZone(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_private_cluster_fqdn_subdomain.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": True,
"privateDNSZone": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io",
},
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"enableRBAC": True,
"fqdnSubdomain": "domain1",
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithFqdnSubdomainSpecified() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
EnablePrivateCluster: to.Ptr(true),
PrivateDNSZone: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"),
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
EnableRBAC: to.Ptr(true),
FqdnSubdomain: to.Ptr("domain1"),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
// EnablePrivateCluster: to.Ptr(true),
// PrivateDNSZone: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"),
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// EnableRBAC: to.Ptr(true),
// FqdnSubdomain: to.Ptr("domain1"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// PrivateFQDN: to.Ptr("domain1.privatelink.location1.azmk8s.io"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
*/
async function createManagedPrivateClusterWithFqdnSubdomainSpecified() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
apiServerAccessProfile: {
enablePrivateCluster: true,
privateDNSZone:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io",
},
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
enableRbac: true,
fqdnSubdomain: "domain1",
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"privateDNSZone": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"enableRBAC": true,
"fqdnSubdomain": "domain1",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "domain1.privatelink.location1.azmk8s.io",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"privateDNSZone": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"enableRBAC": true,
"fqdnSubdomain": "domain1",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "domain1.privatelink.location1.azmk8s.io",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create Managed Private Cluster with Public FQDN specified
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"enablePrivateClusterPublicFQDN": true
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json
*/
/**
* Sample code: Create Managed Private Cluster with Public FQDN specified.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createManagedPrivateClusterWithPublicFQDNSpecified(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS).withMode(AgentPoolMode.SYSTEM)
.withEnableNodePublicIp(true).withEnableEncryptionAtHost(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile().withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withEnablePrivateCluster(true)
.withEnablePrivateClusterPublicFqdn(true)),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_private_cluster_public_fqdn.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"count": 3,
"enableEncryptionAtHost": True,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"apiServerAccessProfile": {"enablePrivateCluster": True, "enablePrivateClusterPublicFQDN": True},
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithPublicFqdnSpecified() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
EnablePrivateCluster: to.Ptr(true),
EnablePrivateClusterPublicFQDN: to.Ptr(true),
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{
// EnablePrivateCluster: to.Ptr(true),
// EnablePrivateClusterPublicFQDN: to.Ptr(true),
// PrivateDNSZone: to.Ptr("system"),
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_PrivateClusterPublicFQDN.json
*/
async function createManagedPrivateClusterWithPublicFqdnSpecified() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableEncryptionAtHost: true,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
apiServerAccessProfile: { enablePrivateCluster: true, enablePrivateClusterPublicFqdn: true },
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"enablePrivateClusterPublicFQDN": true,
"privateDNSZone": "system"
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"enablePrivateClusterPublicFQDN": true,
"privateDNSZone": "system"
},
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-ee788a1f.hcp.location1.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"privateFQDN": "dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update AAD Managed Cluster with EnableAzureRBAC
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"aadProfile": {
"enableAzureRBAC": true,
"managed": true
},
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
*/
/**
* Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createUpdateAADManagedClusterWithEnableAzureRBAC(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS1_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withAvailabilityZones(Arrays.asList("1", "2", "3"))
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile()
.withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile().withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAadProfile(new ManagedClusterAadProfile().withManaged(true).withEnableAzureRbac(true))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_update_with_enable_azure_rbac.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"aadProfile": {"enableAzureRBAC": True, "managed": True},
"addonProfiles": {},
"agentPoolProfiles": [
{
"availabilityZones": ["1", "2", "3"],
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS1_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClusterWithEnableAzureRbac() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AADProfile: &armcontainerservice.ManagedClusterAADProfile{
EnableAzureRBAC: to.Ptr(true),
Managed: to.Ptr(true),
},
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
AvailabilityZones: []*string{
to.Ptr("1"),
to.Ptr("2"),
to.Ptr("3"),
},
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS1_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AADProfile: &armcontainerservice.ManagedClusterAADProfile{
// EnableAzureRBAC: to.Ptr(true),
// Managed: to.Ptr(true),
// TenantID: to.Ptr("tenantID"),
// },
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// AvailabilityZones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3"),
// },
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
*/
async function createOrUpdateAADManagedClusterWithEnableAzureRbac() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
aadProfile: { enableAzureRbac: true, managed: true },
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
availabilityZones: ["1", "2", "3"],
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS1_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"aadProfile": {
"adminGroupObjectIDs": null,
"enableAzureRBAC": true,
"managed": true,
"tenantID": "tenantID"
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"aadProfile": {
"adminGroupObjectIDs": null,
"enableAzureRBAC": true,
"managed": true,
"tenantID": "tenantID"
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update Managed Cluster
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
}
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"upgradeSettings": {
"overrideSettings": {
"forceUpgrade": false,
"until": "2022-11-01T13:00:00Z"
}
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ClusterUpgradeSettings;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.Expander;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.ResourceIdentityType;
import com.azure.resourcemanager.containerservice.models.ScaleDownMode;
import com.azure.resourcemanager.containerservice.models.UpgradeOverrideSettings;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Update.json
*/
/**
* Sample code: Create/Update Managed Cluster.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void
createUpdateManagedCluster(com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.fromString("Basic"))
.withTier(ManagedClusterSkuTier.FREE))
.withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
new ManagedServiceIdentityUserAssignedIdentitiesValue())))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(
new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withScaleDownMode(ScaleDownMode.DEALLOCATE).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withAvailabilityZones(Arrays.asList("1", "2", "3"))
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withUpgradeSettings(new ClusterUpgradeSettings().withOverrideSettings(new UpgradeOverrideSettings()
.withForceUpgrade(false).withUntil(OffsetDateTime.parse("2022-11-01T13:00:00Z"))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true")
.withExpander(Expander.PRIORITY).withMaxNodeProvisionTime("15m").withNewPodScaleUpDelay("1m")
.withScanInterval("20s").withScaleDownDelayAfterAdd("15m").withSkipNodesWithSystemPods("false"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
},
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"availabilityZones": ["1", "2", "3"],
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"scaleDownMode": "Deallocate",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS1_v2",
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false",
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"upgradeSettings": {"overrideSettings": {"forceUpgrade": False, "until": "2022-11-01T13:00:00Z"}},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_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"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_Update.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Identity: &armcontainerservice.ManagedClusterIdentity{
Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
},
},
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
AvailabilityZones: []*string{
to.Ptr("1"),
to.Ptr("2"),
to.Ptr("3"),
},
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate),
VMSize: to.Ptr("Standard_DS1_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
BalanceSimilarNodeGroups: to.Ptr("true"),
Expander: to.Ptr(armcontainerservice.ExpanderPriority),
MaxNodeProvisionTime: to.Ptr("15m"),
NewPodScaleUpDelay: to.Ptr("1m"),
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
SkipNodesWithSystemPods: to.Ptr("false"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{
OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{
ForceUpgrade: to.Ptr(false),
Until: to.Ptr(time.Date(2022, time.November, 1, 13, 0, 0, 0, time.UTC)),
},
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Identity: &armcontainerservice.ManagedClusterIdentity{
// Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// },
// },
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// AvailabilityZones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3"),
// },
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// BalanceSimilarNodeGroups: to.Ptr("true"),
// Expander: to.Ptr(armcontainerservice.ExpanderPriority),
// MaxNodeProvisionTime: to.Ptr("15m"),
// NewPodScaleUpDelay: to.Ptr("1m"),
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// SkipNodesWithSystemPods: to.Ptr("false"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{
// OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{
// ForceUpgrade: to.Ptr(false),
// Until: to.Ptr(time.Date(2022, time.November, 1, 13, 0, 0, 0, time.UTC)),
// },
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_Update.json
*/
async function createOrUpdateManagedCluster() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
availabilityZones: ["1", "2", "3"],
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
scaleDownMode: "Deallocate",
vmSize: "Standard_DS1_v2",
},
],
autoScalerProfile: {
balanceSimilarNodeGroups: "true",
expander: "priority",
maxNodeProvisionTime: "15m",
newPodScaleUpDelay: "1m",
scaleDownDelayAfterAdd: "15m",
scanInterval: "20s",
skipNodesWithSystemPods: "false",
},
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
upgradeSettings: {
overrideSettings: { forceUpgrade: false, until: new Date("2022-11-01T13:00:00Z") },
},
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"upgradeSettings": {
"overrideSettings": {
"forceUpgrade": false,
"until": "2022-11-01T13:00:00Z"
}
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update Managed Cluster with Azure Service Mesh
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"serviceMeshProfile": {
"istio": {
"certificateAuthority": {
"plugin": {
"certChainObjectName": "cert-chain",
"certObjectName": "ca-cert",
"keyObjectName": "ca-key",
"keyVaultId": "/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv",
"rootCertObjectName": "root-cert"
}
},
"components": {
"egressGateways": [
{
"name": "test-istio-egress",
"enabled": true,
"gatewayConfigurationName": "test-gateway-configuration"
}
],
"ingressGateways": [
{
"enabled": true,
"mode": "Internal"
}
]
}
},
"mode": "Istio"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.IstioCertificateAuthority;
import com.azure.resourcemanager.containerservice.models.IstioComponents;
import com.azure.resourcemanager.containerservice.models.IstioEgressGateway;
import com.azure.resourcemanager.containerservice.models.IstioIngressGateway;
import com.azure.resourcemanager.containerservice.models.IstioIngressGatewayMode;
import com.azure.resourcemanager.containerservice.models.IstioPluginCertificateAuthority;
import com.azure.resourcemanager.containerservice.models.IstioServiceMesh;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAddonProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.ServiceMeshMode;
import com.azure.resourcemanager.containerservice.models.ServiceMeshProfile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureServiceMesh.json
*/
/**
* Sample code: Create/Update Managed Cluster with Azure Service Mesh.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createUpdateManagedClusterWithAzureServiceMesh(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1",
new ManagedClusterInner().withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku()
.withName(ManagedClusterSkuName.fromString("Basic")).withTier(ManagedClusterSkuTier.FREE))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(new ManagedClusterServicePrincipalProfile().withClientId("clientid")
.withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf("azureKeyvaultSecretsProvider",
new ManagedClusterAddonProfile().withEnabled(true).withConfig(
mapOf("enableSecretRotation", "fakeTokenPlaceholder", "rotationPollInterval", "2m"))))
.withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile()
.withOutboundType(OutboundType.LOAD_BALANCER).withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(
new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
.withServiceMeshProfile(
new ServiceMeshProfile().withMode(ServiceMeshMode.ISTIO)
.withIstio(new IstioServiceMesh()
.withComponents(new IstioComponents()
.withIngressGateways(Arrays.asList(new IstioIngressGateway()
.withMode(IstioIngressGatewayMode.INTERNAL).withEnabled(true)))
.withEgressGateways(Arrays
.asList(new IstioEgressGateway().withEnabled(true).withName("test-istio-egress")
.withGatewayConfigurationName("test-gateway-configuration"))))
.withCertificateAuthority(new IstioCertificateAuthority()
.withPlugin(new IstioPluginCertificateAuthority().withKeyVaultId("fakeTokenPlaceholder")
.withCertObjectName("ca-cert").withKeyObjectName("fakeTokenPlaceholder")
.withRootCertObjectName("root-cert").withCertChainObjectName("cert-chain"))))),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_azure_service_mesh.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {"enableSecretRotation": "true", "rotationPollInterval": "2m"},
"enabled": True,
}
},
"agentPoolProfiles": [
{
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS2_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"serviceMeshProfile": {
"istio": {
"certificateAuthority": {
"plugin": {
"certChainObjectName": "cert-chain",
"certObjectName": "ca-cert",
"keyObjectName": "ca-key",
"keyVaultId": "/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv",
"rootCertObjectName": "root-cert",
}
},
"components": {
"egressGateways": [
{
"enabled": True,
"gatewayConfigurationName": "test-gateway-configuration",
"name": "test-istio-egress",
}
],
"ingressGateways": [{"enabled": True, "mode": "Internal"}],
},
},
"mode": "Istio",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureServiceMesh.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_AzureServiceMesh.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithAzureServiceMesh() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{
"azureKeyvaultSecretsProvider": {
Config: map[string]*string{
"enableSecretRotation": to.Ptr("true"),
"rotationPollInterval": to.Ptr("2m"),
},
Enabled: to.Ptr(true),
},
},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{
Istio: &armcontainerservice.IstioServiceMesh{
CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{
Plugin: &armcontainerservice.IstioPluginCertificateAuthority{
CertChainObjectName: to.Ptr("cert-chain"),
CertObjectName: to.Ptr("ca-cert"),
KeyObjectName: to.Ptr("ca-key"),
KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"),
RootCertObjectName: to.Ptr("root-cert"),
},
},
Components: &armcontainerservice.IstioComponents{
EgressGateways: []*armcontainerservice.IstioEgressGateway{
{
Name: to.Ptr("test-istio-egress"),
Enabled: to.Ptr(true),
GatewayConfigurationName: to.Ptr("test-gateway-configuration"),
},
},
IngressGateways: []*armcontainerservice.IstioIngressGateway{
{
Enabled: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal),
},
},
},
},
Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{
// "azureKeyvaultSecretsProvider": &armcontainerservice.ManagedClusterAddonProfile{
// Config: map[string]*string{
// "enableSecretRotation": to.Ptr("true"),
// "rotationPollInterval": to.Ptr("2m"),
// },
// Enabled: to.Ptr(true),
// },
// },
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// Count: to.Ptr[int32](3),
// EnableEncryptionAtHost: to.Ptr(true),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{
// Istio: &armcontainerservice.IstioServiceMesh{
// CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{
// Plugin: &armcontainerservice.IstioPluginCertificateAuthority{
// CertChainObjectName: to.Ptr("cert-chain"),
// CertObjectName: to.Ptr("ca-cert"),
// KeyObjectName: to.Ptr("ca-key"),
// KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"),
// RootCertObjectName: to.Ptr("root-cert"),
// },
// },
// Components: &armcontainerservice.IstioComponents{
// EgressGateways: []*armcontainerservice.IstioEgressGateway{
// {
// Name: to.Ptr("test-istio-egress"),
// Enabled: to.Ptr(true),
// GatewayConfigurationName: to.Ptr("test-gateway-configuration"),
// },
// },
// IngressGateways: []*armcontainerservice.IstioIngressGateway{
// {
// Enabled: to.Ptr(true),
// Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal),
// },
// },
// },
// Revisions: []*string{
// to.Ptr("asm-1-17"),
// },
// },
// Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio),
// },
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_AzureServiceMesh.json
*/
async function createOrUpdateManagedClusterWithAzureServiceMesh() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
location: "location1",
addonProfiles: {
azureKeyvaultSecretsProvider: {
config: { enableSecretRotation: "true", rotationPollInterval: "2m" },
enabled: true,
},
},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS2_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
serviceMeshProfile: {
istio: {
certificateAuthority: {
plugin: {
certChainObjectName: "cert-chain",
certObjectName: "ca-cert",
keyObjectName: "ca-key",
keyVaultId:
"/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv",
rootCertObjectName: "root-cert",
},
},
components: {
egressGateways: [
{
name: "test-istio-egress",
enabled: true,
gatewayConfigurationName: "test-gateway-configuration",
},
],
ingressGateways: [{ enabled: true, mode: "Internal" }],
},
},
mode: "Istio",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"serviceMeshProfile": {
"istio": {
"certificateAuthority": {
"plugin": {
"certChainObjectName": "cert-chain",
"certObjectName": "ca-cert",
"keyObjectName": "ca-key",
"keyVaultId": "/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv",
"rootCertObjectName": "root-cert"
}
},
"components": {
"egressGateways": [
{
"name": "test-istio-egress",
"enabled": true,
"gatewayConfigurationName": "test-gateway-configuration"
}
],
"ingressGateways": [
{
"enabled": true,
"mode": "Internal"
}
]
},
"revisions": [
"asm-1-17"
]
},
"mode": "Istio"
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"location": "location1",
"properties": {
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": {
"enableSecretRotation": "true",
"rotationPollInterval": "2m"
},
"enabled": true
}
},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"count": 3,
"enableEncryptionAtHost": true,
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS2_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.0.0.0/16"
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"serviceMeshProfile": {
"istio": {
"certificateAuthority": {
"plugin": {
"certChainObjectName": "cert-chain",
"certObjectName": "ca-cert",
"keyObjectName": "ca-key",
"keyVaultId": "/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv",
"rootCertObjectName": "root-cert"
}
},
"components": {
"egressGateways": [
{
"name": "test-istio-egress",
"enabled": true,
"gatewayConfigurationName": "test-gateway-configuration"
}
],
"ingressGateways": [
{
"enabled": true,
"mode": "Internal"
}
]
},
"revisions": [
"asm-1-17"
]
},
"mode": "Istio"
},
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update Managed Cluster with dual-stack networking
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
}
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"ipFamilies": [
"IPv4",
"IPv6"
],
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.Expander;
import com.azure.resourcemanager.containerservice.models.IpFamily;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.ResourceIdentityType;
import com.azure.resourcemanager.containerservice.models.ScaleDownMode;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DualStackNetworking.json
*/
/**
* Sample code: Create/Update Managed Cluster with dual-stack networking.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createUpdateManagedClusterWithDualStackNetworking(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.fromString("Basic"))
.withTier(ManagedClusterSkuTier.FREE))
.withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
new ManagedServiceIdentityUserAssignedIdentitiesValue())))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(Arrays.asList(
new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withScaleDownMode(ScaleDownMode.DEALLOCATE).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withAvailabilityZones(Arrays.asList("1", "2", "3"))
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder"))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))
.withIpFamilies(Arrays.asList(IpFamily.IPV4, IpFamily.IPV6)))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withBalanceSimilarNodeGroups("true")
.withExpander(Expander.PRIORITY).withMaxNodeProvisionTime("15m").withNewPodScaleUpDelay("1m")
.withScanInterval("20s").withScaleDownDelayAfterAdd("15m").withSkipNodesWithSystemPods("false"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_dual_stack_networking.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
},
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"availabilityZones": ["1", "2", "3"],
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"scaleDownMode": "Deallocate",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS1_v2",
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false",
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"ipFamilies": ["IPv4", "IPv6"],
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_DualStackNetworking.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_DualStackNetworking.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithDualStackNetworking() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Identity: &armcontainerservice.ManagedClusterIdentity{
Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
},
},
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
AvailabilityZones: []*string{
to.Ptr("1"),
to.Ptr("2"),
to.Ptr("3"),
},
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate),
VMSize: to.Ptr("Standard_DS1_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
BalanceSimilarNodeGroups: to.Ptr("true"),
Expander: to.Ptr(armcontainerservice.ExpanderPriority),
MaxNodeProvisionTime: to.Ptr("15m"),
NewPodScaleUpDelay: to.Ptr("1m"),
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
SkipNodesWithSystemPods: to.Ptr("false"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
IPFamilies: []*armcontainerservice.IPFamily{
to.Ptr(armcontainerservice.IPFamilyIPv4),
to.Ptr(armcontainerservice.IPFamilyIPv6),
},
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Identity: &armcontainerservice.ManagedClusterIdentity{
// Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// },
// },
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// AvailabilityZones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3"),
// },
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.22.1"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.22.1"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// BalanceSimilarNodeGroups: to.Ptr("true"),
// Expander: to.Ptr(armcontainerservice.ExpanderPriority),
// MaxNodeProvisionTime: to.Ptr("15m"),
// NewPodScaleUpDelay: to.Ptr("1m"),
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// SkipNodesWithSystemPods: to.Ptr("false"),
// },
// CurrentKubernetesVersion: to.Ptr("1.22.1"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.22.1"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// to.Ptr(armcontainerservice.IPFamilyIPv6),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// CountIPv6: to.Ptr[int32](1),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// to.Ptr("fd11:1234::/64"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// to.Ptr("fd00:1234::/108"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_DualStackNetworking.json
*/
async function createOrUpdateManagedClusterWithDualStackNetworking() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
availabilityZones: ["1", "2", "3"],
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
scaleDownMode: "Deallocate",
vmSize: "Standard_DS1_v2",
},
],
autoScalerProfile: {
balanceSimilarNodeGroups: "true",
expander: "priority",
maxNodeProvisionTime: "15m",
newPodScaleUpDelay: "1m",
scaleDownDelayAfterAdd: "15m",
scanInterval: "20s",
skipNodesWithSystemPods: "false",
},
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
ipFamilies: ["IPv4", "IPv6"],
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: { adminPassword: "replacePassword1234$", adminUsername: "azureuser" },
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.22.1",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.22.1",
"osType": "Linux",
"provisioningState": "Succeeded",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"balance-similar-node-groups": "true",
"expander": "priority",
"max-node-provision-time": "15m",
"new-pod-scale-up-delay": "1m",
"scale-down-delay-after-add": "15m",
"scan-interval": "20s",
"skip-nodes-with-system-pods": "false"
},
"currentKubernetesVersion": "1.22.1",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.22.1",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4",
"IPv6"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2,
"countIPv6": 1
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16",
"fd11:1234::/64"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16",
"fd00:1234::/108"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.22.1",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.22.1",
"osType": "Linux",
"provisioningState": "Creating",
"scaleDownMode": "Deallocate",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.22.1",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.22.1",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4",
"IPv6"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2,
"countIPv6": 1
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16",
"fd11:1234::/64"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16",
"fd00:1234::/108"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update Managed Cluster with EnableAHUB
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
}
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser",
"licenseType": "Windows_Server"
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LicenseType;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.ResourceIdentityType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithAHUB.json
*/
/**
* Sample code: Create/Update Managed Cluster with EnableAHUB.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createUpdateManagedClusterWithEnableAHUB(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.fromString("Basic"))
.withTier(ManagedClusterSkuTier.FREE))
.withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
new ManagedServiceIdentityUserAssignedIdentitiesValue())))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS1_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withAvailabilityZones(Arrays.asList("1", "2", "3"))
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder").withLicenseType(LicenseType.WINDOWS_SERVER))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_update_with_ahub.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
},
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"availabilityZones": ["1", "2", "3"],
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS1_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser",
"licenseType": "Windows_Server",
},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithAHUB.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_UpdateWithAHUB.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Identity: &armcontainerservice.ManagedClusterIdentity{
Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
},
},
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
AvailabilityZones: []*string{
to.Ptr("1"),
to.Ptr("2"),
to.Ptr("3"),
},
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS1_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer),
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Identity: &armcontainerservice.ManagedClusterIdentity{
// Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// },
// },
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// AvailabilityZones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3"),
// },
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer),
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWithAHUB.json
*/
async function createOrUpdateManagedClusterWithEnableAhub() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
availabilityZones: ["1", "2", "3"],
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS1_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: {
adminPassword: "replacePassword1234$",
adminUsername: "azureuser",
licenseType: "Windows_Server",
},
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser",
"licenseType": "Windows_Server"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser",
"licenseType": "Windows_Server"
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Create/Update Managed Cluster with Windows gMSA enabled
Przykładowe żądanie
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1?api-version=2026-06-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
}
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"enableNodePublicIP": true,
"mode": "System",
"osType": "Linux",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"networkProfile": {
"loadBalancerProfile": {
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer"
},
"servicePrincipalProfile": {
"clientId": "clientid",
"secret": "secret"
},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser",
"gmsaProfile": {
"enabled": true
}
}
},
"sku": {
"name": "Basic",
"tier": "Free"
},
"tags": {
"archv2": "",
"tier": "production"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.AgentPoolType;
import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
import com.azure.resourcemanager.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.OutboundType;
import com.azure.resourcemanager.containerservice.models.ResourceIdentityType;
import com.azure.resourcemanager.containerservice.models.WindowsGmsaProfile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for ManagedClusters CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWindowsGmsa.json
*/
/**
* Sample code: Create/Update Managed Cluster with Windows gMSA enabled.
*
* @param manager Entry point to ContainerServiceManager.
*/
public static void createUpdateManagedClusterWithWindowsGMSAEnabled(
com.azure.resourcemanager.containerservice.ContainerServiceManager manager) {
manager.serviceClient().getManagedClusters().createOrUpdate("rg1", "clustername1", new ManagedClusterInner()
.withLocation("location1").withTags(mapOf("archv2", "", "tier", "production"))
.withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.fromString("Basic"))
.withTier(ManagedClusterSkuTier.FREE))
.withIdentity(new ManagedClusterIdentity().withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
new ManagedServiceIdentityUserAssignedIdentitiesValue())))
.withKubernetesVersion("").withDnsPrefix("dnsprefix1")
.withAgentPoolProfiles(
Arrays.asList(new ManagedClusterAgentPoolProfile().withCount(3).withVmSize("Standard_DS1_v2")
.withOsType(OSType.LINUX).withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
.withMode(AgentPoolMode.SYSTEM).withAvailabilityZones(Arrays.asList("1", "2", "3"))
.withEnableNodePublicIp(true).withName("nodepool1")))
.withLinuxProfile(new ContainerServiceLinuxProfile().withAdminUsername("azureuser")
.withSsh(new ContainerServiceSshConfiguration().withPublicKeys(
Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("fakeTokenPlaceholder")))))
.withWindowsProfile(new ManagedClusterWindowsProfile().withAdminUsername("azureuser")
.withAdminPassword("fakeTokenPlaceholder").withGmsaProfile(new WindowsGmsaProfile().withEnabled(true)))
.withServicePrincipalProfile(
new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("fakeTokenPlaceholder"))
.withAddonProfiles(mapOf()).withEnableRbac(true)
.withNetworkProfile(new ContainerServiceNetworkProfile().withOutboundType(OutboundType.LOAD_BALANCER)
.withLoadBalancerSku(LoadBalancerSku.STANDARD)
.withLoadBalancerProfile(new ManagedClusterLoadBalancerProfile()
.withManagedOutboundIPs(new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
.withAutoScalerProfile(new ManagedClusterPropertiesAutoScalerProfile().withScanInterval("20s")
.withScaleDownDelayAfterAdd("15m"))
.withDiskEncryptionSetId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
null, null, com.azure.core.util.Context.NONE);
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python managed_clusters_create_update_windows_gmsa.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.managed_clusters.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}
},
},
"location": "location1",
"properties": {
"addonProfiles": {},
"agentPoolProfiles": [
{
"availabilityZones": ["1", "2", "3"],
"count": 3,
"enableNodePublicIP": True,
"mode": "System",
"name": "nodepool1",
"osType": "Linux",
"type": "VirtualMachineScaleSets",
"vmSize": "Standard_DS1_v2",
}
],
"autoScalerProfile": {"scale-down-delay-after-add": "15m", "scan-interval": "20s"},
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": True,
"kubernetesVersion": "",
"linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}},
"networkProfile": {
"loadBalancerProfile": {"managedOutboundIPs": {"count": 2}},
"loadBalancerSku": "standard",
"outboundType": "loadBalancer",
},
"servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"},
"windowsProfile": {
"adminPassword": "replacePassword1234$",
"adminUsername": "azureuser",
"gmsaProfile": {"enabled": True},
},
},
"sku": {"name": "Basic", "tier": "Free"},
"tags": {"archv2": "", "tier": "production"},
},
).result()
print(response)
# x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWindowsGmsa.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v9"
)
// Generated from example definition: 2026-06-01/ManagedClustersCreate_UpdateWindowsGmsa.json
func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithWindowsGMsaEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{
Identity: &armcontainerservice.ManagedClusterIdentity{
Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
},
},
Location: to.Ptr("location1"),
Properties: &armcontainerservice.ManagedClusterProperties{
AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{},
AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
{
Name: to.Ptr("nodepool1"),
Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
AvailabilityZones: []*string{
to.Ptr("1"),
to.Ptr("2"),
to.Ptr("3"),
},
Count: to.Ptr[int32](3),
EnableNodePublicIP: to.Ptr(true),
Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS1_v2"),
},
},
AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
ScaleDownDelayAfterAdd: to.Ptr("15m"),
ScanInterval: to.Ptr("20s"),
},
DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
DNSPrefix: to.Ptr("dnsprefix1"),
EnableRBAC: to.Ptr(true),
KubernetesVersion: to.Ptr(""),
LinuxProfile: &armcontainerservice.LinuxProfile{
AdminUsername: to.Ptr("azureuser"),
SSH: &armcontainerservice.SSHConfiguration{
PublicKeys: []*armcontainerservice.SSHPublicKey{
{
KeyData: to.Ptr("keydata"),
},
},
},
},
NetworkProfile: &armcontainerservice.NetworkProfile{
LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
Count: to.Ptr[int32](2),
},
},
LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard),
OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
},
ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
ClientID: to.Ptr("clientid"),
Secret: to.Ptr("secret"),
},
WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
AdminPassword: to.Ptr("replacePassword1234$"),
AdminUsername: to.Ptr("azureuser"),
GmsaProfile: &armcontainerservice.WindowsGmsaProfile{
Enabled: to.Ptr(true),
},
},
},
SKU: &armcontainerservice.ManagedClusterSKU{
Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")),
Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree),
},
Tags: map[string]*string{
"archv2": to.Ptr(""),
"tier": to.Ptr("production"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcontainerservice.ManagedClustersClientCreateOrUpdateResponse{
// ManagedCluster: armcontainerservice.ManagedCluster{
// Name: to.Ptr("clustername1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"),
// Identity: &armcontainerservice.ManagedClusterIdentity{
// Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// },
// },
// Location: to.Ptr("location1"),
// Properties: &armcontainerservice.ManagedClusterProperties{
// AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{
// {
// Name: to.Ptr("nodepool1"),
// Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets),
// AvailabilityZones: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// to.Ptr("3"),
// },
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableNodePublicIP: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// },
// AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{
// ScaleDownDelayAfterAdd: to.Ptr("15m"),
// ScanInterval: to.Ptr("20s"),
// },
// CurrentKubernetesVersion: to.Ptr("1.9.6"),
// DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
// DNSPrefix: to.Ptr("dnsprefix1"),
// EnableRBAC: to.Ptr(true),
// Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"),
// KubernetesVersion: to.Ptr("1.9.6"),
// LinuxProfile: &armcontainerservice.LinuxProfile{
// AdminUsername: to.Ptr("azureuser"),
// SSH: &armcontainerservice.SSHConfiguration{
// PublicKeys: []*armcontainerservice.SSHPublicKey{
// {
// KeyData: to.Ptr("keydata"),
// },
// },
// },
// },
// MaxAgentPools: to.Ptr[int32](1),
// NetworkProfile: &armcontainerservice.NetworkProfile{
// DNSServiceIP: to.Ptr("10.0.0.10"),
// IPFamilies: []*armcontainerservice.IPFamily{
// to.Ptr(armcontainerservice.IPFamilyIPv4),
// },
// LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{
// AllocatedOutboundPorts: to.Ptr[int32](2000),
// EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"),
// },
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"),
// },
// },
// IdleTimeoutInMinutes: to.Ptr[int32](10),
// ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{
// Count: to.Ptr[int32](2),
// },
// },
// LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic),
// NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet),
// OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer),
// PodCidr: to.Ptr("10.244.0.0/16"),
// PodCidrs: []*string{
// to.Ptr("10.244.0.0/16"),
// },
// ServiceCidr: to.Ptr("10.0.0.0/16"),
// ServiceCidrs: []*string{
// to.Ptr("10.0.0.0/16"),
// },
// },
// NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"),
// ProvisioningState: to.Ptr("Succeeded"),
// ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{
// ClientID: to.Ptr("clientid"),
// },
// WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{
// AdminUsername: to.Ptr("azureuser"),
// GmsaProfile: &armcontainerservice.WindowsGmsaProfile{
// Enabled: to.Ptr(true),
// },
// },
// },
// Tags: map[string]*string{
// "archv2": to.Ptr(""),
// "tier": to.Ptr("production"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates or updates a managed cluster.
*
* @summary creates or updates a managed cluster.
* x-ms-original-file: 2026-06-01/ManagedClustersCreate_UpdateWindowsGmsa.json
*/
async function createOrUpdateManagedClusterWithWindowsGMSAEnabled() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.createOrUpdate("rg1", "clustername1", {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":
{},
},
},
location: "location1",
addonProfiles: {},
agentPoolProfiles: [
{
name: "nodepool1",
type: "VirtualMachineScaleSets",
availabilityZones: ["1", "2", "3"],
count: 3,
enableNodePublicIP: true,
mode: "System",
osType: "Linux",
vmSize: "Standard_DS1_v2",
},
],
autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" },
diskEncryptionSetID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
dnsPrefix: "dnsprefix1",
enableRbac: true,
kubernetesVersion: "",
linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "keydata" }] } },
networkProfile: {
loadBalancerProfile: { managedOutboundIPs: { count: 2 } },
loadBalancerSku: "standard",
outboundType: "loadBalancer",
},
servicePrincipalProfile: { clientId: "clientid", secret: "secret" },
windowsProfile: {
adminPassword: "replacePassword1234$",
adminUsername: "azureuser",
gmsaProfile: { enabled: true },
},
sku: { name: "Basic", tier: "Free" },
tags: { archv2: "", tier: "production" },
});
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
Przykładowa odpowiedź
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Succeeded",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"fqdn": "dnsprefix1-abcd1234.hcp.eastus.azmk8s.io",
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "basic",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Succeeded",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser",
"gmsaProfile": {
"enabled": true
}
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
{
"name": "clustername1",
"type": "Microsoft.ContainerService/managedClusters",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "location1",
"properties": {
"agentPoolProfiles": [
{
"name": "nodepool1",
"type": "VirtualMachineScaleSets",
"availabilityZones": [
"1",
"2",
"3"
],
"count": 3,
"currentOrchestratorVersion": "1.9.6",
"enableNodePublicIP": true,
"maxPods": 110,
"mode": "System",
"orchestratorVersion": "1.9.6",
"osType": "Linux",
"provisioningState": "Creating",
"vmSize": "Standard_DS1_v2"
}
],
"autoScalerProfile": {
"scale-down-delay-after-add": "15m",
"scan-interval": "20s"
},
"currentKubernetesVersion": "1.9.6",
"diskEncryptionSetID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des",
"dnsPrefix": "dnsprefix1",
"enableRBAC": true,
"kubernetesVersion": "1.9.6",
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": "keydata"
}
]
}
},
"maxAgentPools": 1,
"networkProfile": {
"dnsServiceIP": "10.0.0.10",
"ipFamilies": [
"IPv4"
],
"loadBalancerProfile": {
"allocatedOutboundPorts": 2000,
"effectiveOutboundIPs": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"
}
],
"idleTimeoutInMinutes": 10,
"managedOutboundIPs": {
"count": 2
}
},
"loadBalancerSku": "standard",
"networkPlugin": "kubenet",
"outboundType": "loadBalancer",
"podCidr": "10.244.0.0/16",
"podCidrs": [
"10.244.0.0/16"
],
"serviceCidr": "10.0.0.0/16",
"serviceCidrs": [
"10.0.0.0/16"
]
},
"nodeResourceGroup": "MC_rg1_clustername1_location1",
"provisioningState": "Creating",
"servicePrincipalProfile": {
"clientId": "clientid"
},
"windowsProfile": {
"adminUsername": "azureuser",
"gmsaProfile": {
"enabled": true
}
}
},
"tags": {
"archv2": "",
"tier": "production"
}
}
Definicje
| Nazwa |
Opis |
|
AccelerationMode
|
Włącz zaawansowane opcje przyspieszania sieci. Dzięki temu użytkownicy mogą konfigurować akcelerację przy użyciu routingu hosta BPF. Można to włączyć tylko za pomocą płaszczyzny danych Cilium. Jeśli nie zostanie określona, wartość domyślna to Brak (brak przyspieszenia). Tryb przyspieszenia można zmienić na istniejącym klastrze. Zobacz https://aka.ms/acnsperformance szczegółowe wyjaśnienie
|
|
AdvancedNetworking
|
Zaawansowany profil sieci umożliwiający obserwowanie i pakiet funkcji zabezpieczeń w klastrze. Aby uzyskać więcej informacji, zobacz aka.ms/aksadvancednetworking.
|
|
AdvancedNetworkingObservability
|
Profil obserwacji umożliwiający włączenie zaawansowanych metryk sieci i dzienników przepływu z kontekstami historycznymi.
|
|
AdvancedNetworkingPerformance
|
Profil umożliwiający funkcje zwiększające wydajność na klastrach korzystających z Azure CNI opartego na Cilium.
|
|
AdvancedNetworkingSecurity
|
Profil zabezpieczeń umożliwiający włączenie funkcji zabezpieczeń w klastrze opartym na cilium.
|
|
AdvancedNetworkingSecurityTransitEncryption
|
Konfiguracja szyfrowania dla klastrów opartych na rzęskach. Po włączeniu cały ruch między zasobnikami zarządzanymi przez Cilium będzie szyfrowany, gdy opuści granicę węzła.
|
|
AdvancedNetworkPolicies
|
Włącz zaawansowane zasady sieciowe. Dzięki temu użytkownicy mogą konfigurować zasady sieciowe warstwy 7 (FQDN, HTTP, Kafka). Zasady muszą być konfigurowane za pośrednictwem zasobów zasad sieciowych cilium, zobacz https://docs.cilium.io/en/latest/security/policy/index.html. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to FQDN, jeśli wartość security.enabled jest ustawiona na true.
|
|
AgentPoolArtifactStreamingProfile
|
Profil streamingowy artefaktów dla puli 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 access SSH do 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.
|
|
ArtifactSource
|
Źródło artefaktu. Źródło, z którego są pobierane artefakty.
|
|
AutoScaleProfile
|
Specyfikacje dotyczące automatycznego skalowania.
|
|
AzureKeyVaultKms
|
Ustawienia usługi zarządzania kluczami usługi Azure Key Vault dla profilu zabezpieczeń.
|
|
BackendPoolType
|
Typ zarządzanego Load Balancer BackendPool zarządzanego ruchu przychodzącego.
|
|
ClusterUpgradeSettings
|
Ustawienia uaktualniania klastra.
|
|
Code
|
Informuje, czy klaster jest uruchomiony, czy zatrzymany
|
|
ContainerNetworkLogs
|
Dozwolone wartości dla pobierania logów sieciowych kontenerów z Azure Monitor. Gdy Enabled, konkretne typy logów pobierane są kontrolowane przez powiązany CRD; domyślnie przyjmuje .Disabled Zobacz https://aka.ms/ContainerNetworkLogsDoc i https://aka.ms/acns/howtoenablecnl szczegóły.
|
|
ContainerServiceLinuxProfile
|
Profil maszyn wirtualnych z systemem Linux w klastrze usługi kontenera.
|
|
ContainerServiceNetworkProfile
|
Profil konfiguracji sieci.
|
|
ContainerServiceSshConfiguration
|
Konfiguracja SSH dla maszyn wirtualnych opartych na Linuksie, działających na Azure.
|
|
ContainerServiceSshPublicKey
|
Zawiera informacje o danych klucza publicznego certyfikatu SSH.
|
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
|
CreationData
|
Dane używane podczas tworzenia zasobu docelowego na podstawie zasobu źródłowego.
|
|
DelegatedResource
|
Właściwości delegowanego zasobu — tylko do użytku wewnętrznego.
|
|
DRANETMode
|
Tryb DRANET dla puli agentów.
|
|
DRANETProfile
|
Ustawienia DRANET puli agentów.
|
|
ErrorAdditionalInfo
|
Dodatkowe informacje o błędzie zarządzania zasobami.
|
|
ErrorDetail
|
Szczegóły błędu.
|
|
ErrorResponse
|
Odpowiedź na błąd
|
|
Expander
|
Ekspander do użycia podczas skalowania w górę. Jeśli nie zostanie określony, wartość domyślna to "losowe". Zobacz expanders aby uzyskać więcej informacji.
|
|
ExtendedLocation
|
Typ złożony lokalizacji rozszerzonej.
|
|
ExtendedLocationTypes
|
Typ extendedLocation.
|
|
GatewayAPIIstioEnabled
|
Czy włączyć Istio jako implementację API bramy dla zarządzanego wejścia z pomocą trasowania aplikacji.
|
|
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.
|
|
IPFamily
|
Aby określić, czy adres należy do rodziny IPv4 czy IPv6
|
|
IPTag
|
Zawiera element IPTag skojarzony z obiektem .
|
|
IstioCertificateAuthority
|
Konfiguracja urzędu certyfikacji usługi Istio Service Mesh. Na razie obsługujemy tylko certyfikaty wtyczek zgodnie z opisem w tym miejscu https://aka.ms/asm-plugin-ca
|
|
IstioComponents
|
Konfiguracja składników istio.
|
|
IstioEgressGateway
|
Konfiguracja bramy ruchu wychodzącego Istio.
|
|
IstioIngressGateway
|
Konfiguracja bramy ruchu przychodzącego istio. Na razie obsługujemy maksymalnie jedną zewnętrzną bramę ruchu przychodzącego o nazwie aks-istio-ingressgateway-external i jedną wewnętrzną bramę ruchu przychodzącego o nazwie aks-istio-ingressgateway-internal.
|
|
IstioIngressGatewayMode
|
Tryb bramy ruchu przychodzącego.
|
|
IstioPluginCertificateAuthority
|
Informacje o certyfikatach wtyczki dla usługi Service Mesh.
|
|
IstioServiceMesh
|
Konfiguracja siatki usługi Istio.
|
|
KeyVaultNetworkAccessTypes
|
Sieciowe access key vault. Dostęp sieciowy do magazynu kluczy. Możliwe wartości to Public i Private.
Public oznacza, że key vault umożliwia publiczne access ze wszystkich sieci.
Private oznacza, że key vault wyłącza publiczne access i umożliwia private link. Wartość domyślna to Public.
|
|
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 rozmieszczenie woluminów emptyDir, root danych w czasie rzeczywistym kontenera oraz ephemeral storage Kubeleta.
|
|
KubernetesSupportPlan
|
Różne warstwy pomocy technicznej dla klastrów zarządzanych przez usługę AKS
|
|
LicenseType
|
Typ licencji do użycia dla maszyn wirtualnych z systemem Windows. Zobacz Azure Korzyści dla Hybrydowych Użytkowników aby uzyskać więcej szczegółów.
|
|
LinuxOSConfig
|
Konfiguracje systemu operacyjnego węzłów agenta systemu Linux. Aby uzyskać więcej informacji, zobacz konfiguracji niestandardowego węzła usługi AKS.
|
|
LoadBalancerSku
|
Jednostka SKU modułu równoważenia obciążenia dla klastra zarządzanego. Wartość domyślna to "Standardowa". Zobacz Azure Load Balancer SKU aby uzyskać więcej informacji o różnicach między load balancer SKU.
|
|
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.
|
|
ManagedCluster
|
Klaster zarządzany.
|
|
ManagedClusterAADProfile
|
AADProfile określa atrybuty integracji z Azure Active Directory. Aby uzyskać więcej informacji, zobacz managed AAD on AKS.
|
|
ManagedClusterAddonProfile
|
Profil dodatku Kubernetes dla klastra zarządzanego.
|
|
ManagedClusterAddonProfileIdentity
|
Informacje o tożsamości przypisanej przez użytkownika używanej przez ten dodatek.
|
|
ManagedClusterAgentPoolProfile
|
Profil puli agentów usługi kontenera.
|
|
ManagedClusterAIToolchainOperatorProfile
|
Po włączeniu operatora w klastrze zostanie zainstalowany zestaw zarządzanych identyfikatorów CRD i kontrolerów usługi AKS. Operator automatyzuje wdrażanie modeli systemu operacyjnego na potrzeby wnioskowania i/lub trenowania. Zapewnia zestaw wstępnie ustawionych modeli i umożliwia rozproszone wnioskowanie względem nich.
|
|
ManagedClusterAPIServerAccessProfile
|
Profil dostępu dla serwera interfejsu API klastra zarządzanego.
|
|
ManagedClusterAppRoutingIstio
|
Konfiguracja do użycia płaszczyzny sterującej Istio bez sidecarów do zarządzanego wejścia za pośrednictwem API Gateway z routowaniem aplikacji. Zobacz https://aka.ms/gateway-on-istio informacje o wykorzystaniu Istio do wejścia przez API bramy.
|
|
ManagedClusterAutoUpgradeProfile
|
Profil automatycznego uaktualniania dla klastra zarządzanego.
|
|
ManagedClusterAzureMonitorProfile
|
Profile dodatków Azure Monitor do monitorowania zarządzanego klastra.
|
|
ManagedClusterAzureMonitorProfileAppMonitoring
|
Profil monitorowania aplikacji dla AKS.
|
|
ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation
|
Monitorowanie aplikacji do autoinstrumentacji dla AKS. Wdraża webhook, który automatycznie uruchamia obciążenia z dystrybucjami Microsoft OpenTelemetry do zbierania metryk, logów i śledzeń OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
|
|
ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsAndTraces
|
Monitorowanie aplikacji OpenTelemetry logi i profile śledzeń dla AKS. Zbiera logi OpenTelemetry i ślady aplikacji za pomocą SDK opartych na Azure Monitor OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
|
|
ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics
|
Monitorowanie aplikacji OpenTelemetry Metrics Profile dla AKS. Zbiera metryki OpenTelemetry aplikacji za pomocą SDK opartych na Azure Monitor OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
|
|
ManagedClusterAzureMonitorProfileContainerInsights
|
Azure Monitor Container Insights profile. Reprezentuje konfigurację zbierania zdarzeń Kubernetes, inwentarza oraz rejestrów stdout i stderr w kontenerach. Zobacz aka.ms/AzureMonitorContainerInsights, aby zapoznać się z omówieniem.
|
|
ManagedClusterAzureMonitorProfileKubeStateMetrics
|
Kube State Metrics profile dla Azure Managed Prometheus addon. Te opcjonalne ustawienia dotyczą zasobnika kube-state-metrics wdrożonego za pomocą dodatku. Aby uzyskać szczegółowe informacje, zobacz aka.ms/AzureManagedPrometheus-optional-parameters.
|
|
ManagedClusterAzureMonitorProfileMetrics
|
Profil metryki dla Azure Monitor managed service for Prometheus addon. Zbieraj gotowe metryki infrastruktury Kubernetes, które wysyłasz do Azure Monitor Workspace i konfiguruj dodatkowe scraping dla niestandardowych celów. Aby zapoznać się z omówieniem, zobacz aka.ms/AzureManagedPrometheus.
|
|
ManagedClusterAzureMonitorProfileMetricsControlPlane
|
Control plane metrics collection profile dla Azure Managed Prometheus addon. Konfiguruje zbieranie metryk operacyjnych z poziomu zarządzanego płaszczyzny sterowania (kube-apiserver, etcd itd.). Zobacz aka.ms/aks/controlplane-metrics po przegląd.
|
|
ManagedClusterBootstrapProfile
|
Profil bootstrap.
|
|
ManagedClusterCostAnalysis
|
Konfiguracja analizy kosztów klastra
|
|
ManagedClusterHostedSystemProfile
|
Ustawienia hostowanych dodatków systemowych.
|
|
ManagedClusterHTTPProxyConfig
|
Konfiguracja serwera proxy HTTP klastra.
|
|
ManagedClusterIdentity
|
Tożsamość klastra zarządzanego.
|
|
ManagedClusterIngressProfile
|
Profil ruchu przychodzącego dla klastra usługi kontenera.
|
|
ManagedClusterIngressProfileGatewayConfiguration
|
Konfiguracja zarządzanych CRD API bram. Aby uzyskać więcej informacji, zobacz https://aka.ms/k8s-gateway-api.
|
|
ManagedClusterIngressProfileNginx
|
Konfiguracja kontrolera ingress nginx dla profilu zarządzania klastrem wejściowym.
|
|
ManagedClusterIngressProfileWebAppRouting
|
Ustawienia dodatku routingu aplikacji dla profilu ruchu przychodzącego.
|
|
ManagedClusterLoadBalancerProfile
|
Profil modułu równoważenia obciążenia klastra zarządzanego.
|
|
ManagedClusterLoadBalancerProfileManagedOutboundIPs
|
Pożądane zarządzane adresy IP wychodzące dla klastra load balancer.
|
|
ManagedClusterLoadBalancerProfileOutboundIPPrefixes
|
Żądane zasoby prefiksu adresów IP dla modułu równoważenia obciążenia klastra.
|
|
ManagedClusterLoadBalancerProfileOutboundIPs
|
Żądane zasoby adresów IP ruchu wychodzącego dla modułu równoważenia obciążenia klastra.
|
|
ManagedClusterManagedOutboundIPProfile
|
Profil zarządzanych zasobów wychodzących IP klastra zarządzanego.
|
|
ManagedClusterMetricsProfile
|
Profil metryk zarządzanychcluster.
|
|
ManagedClusterNATGatewayProfile
|
Profil bramy translatora adresów sieciowych klastra zarządzanego.
|
|
ManagedClusterNATGatewaySku
|
SKU zarządzanego klastra NAT Gateway.
|
|
ManagedClusterNodeProvisioningProfile
|
Profil provisioningu węzłów dla zarządzanego klastra.
|
|
ManagedClusterNodeResourceGroupProfile
|
Profil blokady grupy zasobów węzła dla klastra zarządzanego.
|
|
ManagedClusterOIDCIssuerProfile
|
Profil wystawcy OIDC klastra zarządzanego.
|
|
ManagedClusterPodIdentity
|
Szczegółowe informacje o tożsamości zasobnika przypisanej do klastra zarządzanego.
|
|
ManagedClusterPodIdentityException
|
Wyjątek tożsamości podu, który pozwala kapsłom z określonymi etykietami uzyskać dostęp do punktu końcowego Azure Instance Metadata Service (IMDS) bez przechwycenia przez serwer tożsamości zarządzany przez węzeł (NMI). Aby uzyskać więcej informacji, zobacz disable AAD Pod Identity for a specific Pod/Application (Wyłączanie tożsamości zasobnika usługi AAD).
|
|
ManagedClusterPodIdentityProfile
|
Profil tożsamości zasobnika klastra zarządzanego. Zobacz używanie tożsamości zasobnika usługi AAD, aby uzyskać więcej informacji na temat integracji tożsamości zasobnika.
|
|
ManagedClusterPodIdentityProvisioningError
|
Odpowiedź na błąd z aprowizacji tożsamości zasobnika.
|
|
ManagedClusterPodIdentityProvisioningErrorBody
|
Odpowiedź na błąd z aprowizacji tożsamości zasobnika.
|
|
ManagedClusterPodIdentityProvisioningInfo
|
Informacje o przydzielaniu tożsamości kapsuły.
|
|
ManagedClusterPodIdentityProvisioningState
|
Bieżący stan aprowizacji tożsamości zasobnika.
|
|
ManagedClusterPropertiesAutoScalerProfile
|
Parametry, które mają być stosowane do skalowania automatycznego klastra po włączeniu
|
|
ManagedClusterSecurityProfile
|
Profil zabezpieczeń klastra usługi kontenera.
|
|
ManagedClusterSecurityProfileDefender
|
Ustawienia Microsoft Defender dla profilu bezpieczeństwa.
|
|
ManagedClusterSecurityProfileDefenderSecurityGating
|
Ustawienia Microsoft Defender dla zabezpieczeń (security gating). To potwierdza kwalifikację obrazów kontenerów do wdrożenia na podstawie wyników bezpieczeństwa Defender for Containers. Za pomocą Admission Controller audytuje lub uniemożliwia wdrażanie obrazów niespełniających standardów bezpieczeństwa.
|
|
ManagedClusterSecurityProfileDefenderSecurityGatingIdentity
|
Mapowanie tożsamości używane przez Defender do zabezpieczeń do dostępu do rejestru.
|
|
ManagedClusterSecurityProfileDefenderSecurityMonitoring
|
Ustawienia Microsoft Defender dotyczące wykrywania zagrożeń w profilu bezpieczeństwa.
|
|
ManagedClusterSecurityProfileImageCleaner
|
Narzędzie Image Cleaner usuwa nieużywane obrazy z węzłów, zwalniając miejsce na dysku i pomagając zmniejszyć obszar powierzchni podatnej na ataki. Poniżej przedstawiono ustawienia profilu zabezpieczeń.
|
|
ManagedClusterSecurityProfileWorkloadIdentity
|
Ustawienia tożsamości obciążenia dla profilu zabezpieczeń.
|
|
ManagedClusterServicePrincipalProfile
|
Informacje o tożsamości głównej usługi dla klastra do manipulacji API Azure.
|
|
ManagedClusterSKU
|
Jednostka SKU klastra zarządzanego.
|
|
ManagedClusterSKUName
|
Nazwa jednostki SKU klastra zarządzanego.
|
|
ManagedClusterSKUTier
|
Warstwa jednostki SKU klastra zarządzanego. Jeśli nie zostanie określony, wartość domyślna to "Bezpłatna". Zobacz AKS Pricing Tier aby uzyskać więcej szczegółów.
|
|
ManagedClusterStaticEgressGatewayProfile
|
Konfiguracja dodatku static Egress Gateway dla klastra.
|
|
ManagedClusterStatus
|
Zawiera informacje tylko do odczytu dotyczące klastra zarządzanego.
|
|
ManagedClusterStorageProfile
|
Profil magazynu dla klastra usługi kontenera.
|
|
ManagedClusterStorageProfileBlobCSIDriver
|
Ustawienia sterownika CSI AzureBlob dla profilu storage.
|
|
ManagedClusterStorageProfileDiskCSIDriver
|
Ustawienia sterownika CSI AzureDisk dla profilu storage.
|
|
ManagedClusterStorageProfileFileCSIDriver
|
Ustawienia sterownika CSI AzureFile dla profilu storage.
|
|
ManagedClusterStorageProfileSnapshotController
|
Ustawienia Snapshot Controller dla profilu storage.
|
|
ManagedClusterWebAppRoutingGatewayAPIImplementations
|
Konfiguracje dla dostawców API bram do zarządzania wejściem z pomocą trasowania aplikacji.
|
|
ManagedClusterWindowsProfile
|
Profil dla maszyn wirtualnych Windows w zarządzanym klastrze.
|
|
ManagedClusterWorkloadAutoScalerProfile
|
Profil automatycznego skalowania obciążenia dla klastra zarządzanego.
|
|
ManagedClusterWorkloadAutoScalerProfileKeda
|
Ustawienia skalowania automatycznego opartego na zdarzeniach platformy KEDA (Kubernetes Event-driven Autoscaling) dla profilu automatycznego skalowania obciążenia.
|
|
ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler
|
Ustawienia narzędzia VPA (vertical Pod Autoscaler) dla profilu automatycznego skalowania obciążenia.
|
|
ManagedGatewayType
|
Konfiguracja instalacji interfejsu API bramy zarządzanej. Jeśli nie zostanie określony, wartość domyślna to "Wyłączone". Aby uzyskać więcej informacji, zobacz https://aka.ms/k8s-gateway-api.
|
|
ManagedServiceIdentityUserAssignedIdentitiesValue
|
Właściwości tożsamości przypisanej przez użytkownika.
|
|
ManualScaleProfile
|
Specyfikacje dotyczące liczby maszyn.
|
|
NetworkDataplane
|
Plan danych sieci używany w klastrze Kubernetes.
|
|
NetworkMode
|
Tryb sieciowy, z którym skonfigurowany jest Azure CNI. Nie można tego określić, jeśli networkPlugin jest czymś innym niż 'azure'.
|
|
NetworkPlugin
|
Wtyczka sieci używana do tworzenia sieci Kubernetes.
|
|
NetworkPluginMode
|
Tryb, który ma być używany przez wtyczkę sieci.
|
|
NetworkPolicy
|
Zasady sieci używane do tworzenia sieci Kubernetes.
|
|
NginxIngressControllerType
|
Typ ruchu przychodzącego domyślnego zasobu niestandardowego NginxIngressController
|
|
NodeOSUpgradeChannel
|
Kanał uaktualniania systemu operacyjnego węzła. Sposób aktualizowania systemu operacyjnego w węzłach. Wartość domyślna to NodeImage.
|
|
NodeProvisioningDefaultNodePools
|
Zestaw domyślnych pul węzłów Karpenter (CRD) skonfigurowanych do aprowizacji węzłów. To pole nie działa, chyba że tryb ma wartość "Auto". Ostrzeżenie: Zmiana tej opcji z Automatycznie na Brak w istniejącym klastrze spowoduje usunięcie domyślnych pul węzłów Karpenter, co spowoduje opróżnienie i usunięcie węzłów skojarzonych z tymi pulami. Zdecydowanie zaleca się, aby tego nie robić, chyba że istnieją bezczynne węzły gotowe do podjęcia zasobników eksmitowanych przez tę akcję. Jeśli nie zostanie określony, wartość domyślna to Auto. Aby uzyskać więcej informacji, zobacz aka.ms/aks/nap#node-pools.
|
|
NodeProvisioningMode
|
Tryb aprowizacji węzła. Jeśli nie zostanie określony, wartość domyślna to Ręczne.
|
|
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. Więcej informacji można znaleźć w Ephemeral OS.
|
|
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 Kubernetes <>= 1.25, jeśli typ systemu operacyjnego to Windows.
|
|
OSType
|
Typ systemu operacyjnego. Wartość domyślna to Linux.
|
|
OutboundIPPrefixes
|
Pożądane zasoby prefiksu IP wychodzącego dla zarządzanej bramy NAT. Kompatybilny tylko z NAT Gateway V2.
|
|
OutboundIPs
|
Pożądane wychodzące zasoby IP dla zarządzanej bramy NAT.
|
|
OutboundType
|
Metoda routingu ruchu wychodzącego (wychodzącego). Można to ustawić tylko w czasie tworzenia klastra i nie można go zmienić później. Więcej informacji można znaleźć w egress outbound type.
|
|
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
|
|
PrivateLinkResource
|
Zasób łącza prywatnego
|
|
Protocol
|
Protokół sieciowy portu.
|
|
ProxyRedirectionMechanism
|
Tryb przekierowania ruchu.
|
|
PublicNetworkAccess
|
PublicNetworkAccess klastra zarządzanego. Zezwalaj lub odmawiaj access do sieci publicznej dla AKS
|
|
ResourceIdentityType
|
Typ tożsamości używany dla klastra zarządzanego. Więcej informacji można znaleźć w use managed identities in AKS.
|
|
ResourceReference
|
Odniesienie do zasobu Azure.
|
|
RestrictionLevel
|
Poziom ograniczeń zastosowany do grupy zasobów węzła klastra. Jeśli nie zostanie określony, wartość domyślna to "Bez ograniczeń"
|
|
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. Polityka eksmisji określa, co to do VM po jego eksmitacji. Wartość domyślna to Usuń. Więcej informacji o eksmisji można znaleźć w spot VMs
|
|
ScaleSetPriority
|
Priorytet zestawu skalowania maszyn wirtualnych.
|
|
SchedulerConfigMode
|
Tryb dostosowywania konfiguracji dla tego wystąpienia harmonogramu.
|
|
SchedulerInstanceProfile
|
Profil z ustawieniami związanymi z konkretną instancją harmonogramu zarządzanego przez AKS.
|
|
SchedulerProfile
|
Profil z ustawieniami związanymi z harmonogramem, takimi jak tryb konfiguracji dla każdego planisty zarządzany przez AKS. Zobacz: https://aka.ms/aks/scheduler-profile.
|
|
ServiceMeshMode
|
Tryb siatki usług.
|
|
ServiceMeshProfile
|
Profil usługi Service Mesh dla klastra zarządzanego.
|
|
SysctlConfig
|
Ustawienia sysctl dla węzłów agenta systemu Linux.
|
|
systemData
|
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
|
|
TransitEncryptionType
|
Konfiguruje szyfrowanie zasobników między zasobnikami. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to Brak.
|
|
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.
|
|
UpgradeChannel
|
Kanał uaktualniania na potrzeby automatycznego uaktualniania. Wartość domyślna to "none". Więcej informacji można znaleźć w setting the AKS auto-upgrade channel of cluster.
|
|
UpgradeOverrideSettings
|
Ustawienia przesłonięć podczas uaktualniania klastra.
|
|
UserAssignedIdentity
|
Szczegółowe informacje o tożsamości przypisanej przez użytkownika.
|
|
VirtualMachineNodes
|
Bieżący stan w grupie węzłów o tym samym rozmiarze maszyny wirtualnej.
|
|
VirtualMachinesProfile
|
Specyfikacje w puli agentów VirtualMachines.
|
|
WindowsGmsaProfile
|
Profil Windows gMSA w zarządzanym klastrze.
|
|
WorkloadRuntime
|
Określa typ obciążenia, który może uruchomić węzeł.
|
AccelerationMode
Wyliczenie
Włącz zaawansowane opcje przyspieszania sieci. Dzięki temu użytkownicy mogą konfigurować akcelerację przy użyciu routingu hosta BPF. Można to włączyć tylko za pomocą płaszczyzny danych Cilium. Jeśli nie zostanie określona, wartość domyślna to Brak (brak przyspieszenia). Tryb przyspieszenia można zmienić na istniejącym klastrze. Zobacz https://aka.ms/acnsperformance szczegółowe wyjaśnienie
| Wartość |
Opis |
|
BpfVeth
|
Włącz routing hosta eBPF w trybie urządzenia veth.
|
|
None
|
Wyłącz opcje przyspieszenia.
|
AdvancedNetworking
Objekt
Zaawansowany profil sieci umożliwiający obserwowanie i pakiet funkcji zabezpieczeń w klastrze. Aby uzyskać więcej informacji, zobacz aka.ms/aksadvancednetworking.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Wskazuje włączenie zaawansowanych funkcji sieciowych dotyczących możliwości obserwowania i zabezpieczeń w klastrach usługi AKS. Po ustawieniu wartości true wszystkie funkcje obserwowania i zabezpieczeń zostaną ustawione na włączone, chyba że jawnie wyłączone. Jeśli nie zostanie określony, wartość domyślna to false.
|
|
observability
|
AdvancedNetworkingObservability
|
Profil obserwacji umożliwiający włączenie zaawansowanych metryk sieci i dzienników przepływu z kontekstami historycznymi.
|
|
performance
|
AdvancedNetworkingPerformance
|
Profil umożliwiający funkcje zwiększające wydajność na klastrach korzystających z Azure CNI opartego na Cilium.
|
|
security
|
AdvancedNetworkingSecurity
|
Profil zabezpieczeń umożliwiający włączenie funkcji zabezpieczeń w klastrze opartym na cilium.
|
AdvancedNetworkingObservability
Objekt
Profil obserwacji umożliwiający włączenie zaawansowanych metryk sieci i dzienników przepływu z kontekstami historycznymi.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Wskazuje włączenie funkcji obserwacji zaawansowanej sieci w klastrach.
|
Objekt
Profil umożliwiający funkcje zwiększające wydajność na klastrach korzystających z Azure CNI opartego na Cilium.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
accelerationMode
|
AccelerationMode
|
None
|
Włącz zaawansowane opcje przyspieszania sieci. Dzięki temu użytkownicy mogą konfigurować akcelerację przy użyciu routingu hosta BPF. Można to włączyć tylko za pomocą płaszczyzny danych Cilium. Jeśli nie zostanie określona, wartość domyślna to Brak (brak przyspieszenia). Tryb przyspieszenia można zmienić na istniejącym klastrze. Zobacz https://aka.ms/acnsperformance szczegółowe wyjaśnienie
|
AdvancedNetworkingSecurity
Objekt
Profil zabezpieczeń umożliwiający włączenie funkcji zabezpieczeń w klastrze opartym na cilium.
| Nazwa |
Typ |
Opis |
|
advancedNetworkPolicies
|
AdvancedNetworkPolicies
|
Włącz zaawansowane zasady sieciowe. Dzięki temu użytkownicy mogą konfigurować zasady sieciowe warstwy 7 (FQDN, HTTP, Kafka). Zasady muszą być konfigurowane za pośrednictwem zasobów zasad sieciowych cilium, zobacz https://docs.cilium.io/en/latest/security/policy/index.html. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to FQDN, jeśli wartość security.enabled jest ustawiona na true.
|
|
enabled
|
boolean
|
Ta funkcja umożliwia użytkownikowi konfigurowanie zasad sieciowych na podstawie nazw DNS (FQDN). Można ją włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to false.
|
|
transitEncryption
|
AdvancedNetworkingSecurityTransitEncryption
|
Konfiguracja szyfrowania dla klastrów opartych na rzęskach. Po włączeniu cały ruch między zasobnikami zarządzanymi przez Cilium będzie szyfrowany, gdy opuści granicę węzła.
|
AdvancedNetworkingSecurityTransitEncryption
Objekt
Konfiguracja szyfrowania dla klastrów opartych na rzęskach. Po włączeniu cały ruch między zasobnikami zarządzanymi przez Cilium będzie szyfrowany, gdy opuści granicę węzła.
| Nazwa |
Typ |
Opis |
|
type
|
TransitEncryptionType
|
Konfiguruje szyfrowanie zasobników między zasobnikami. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to Brak.
|
AdvancedNetworkPolicies
Wyliczenie
Włącz zaawansowane zasady sieciowe. Dzięki temu użytkownicy mogą konfigurować zasady sieciowe warstwy 7 (FQDN, HTTP, Kafka). Zasady muszą być konfigurowane za pośrednictwem zasobów zasad sieciowych cilium, zobacz https://docs.cilium.io/en/latest/security/policy/index.html. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to FQDN, jeśli wartość security.enabled jest ustawiona na true.
| Wartość |
Opis |
|
L7
|
Włącz zasady sieciowe warstwy 7 (FQDN, HTTP/S, Kafka). Ta opcja jest nadzbiorem opcji FQDN.
|
|
FQDN
|
Włączanie zasad sieciowych opartych na nazwach FQDN
|
|
None
|
Wyłączanie zasad sieciowych warstwy 7 (FQDN, HTTP/S, Kafka)
|
AgentPoolArtifactStreamingProfile
Objekt
Profil streamingowy artefaktów dla puli agentów.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Przesyłanie strumieniowe artefaktów przyspiesza zimny start kontenerów w węźle za pośrednictwem ładowania obrazu na żądanie. Aby korzystać z tej funkcji, obrazy kontenerów muszą również włączyć przesyłanie strumieniowe artefaktów w usłudze ACR. Jeśli nie zostanie określony, wartość domyślna to false.
|
AgentPoolGatewayProfile
Objekt
Profil puli agentów bramy klastra zarządzanego.
| Nazwa |
Typ |
Domyślna wartość |
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 IPPrefix w Azure, zakres wartości prawidłowych wynosi [28, 31] (/31 = 2 węzły/IP, /30 = 4 węzły/IP, /29 = 8 węzłów/IP, /28 = 16 węzłó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ą przeznaczone głównie do hostowania krytycznych zasobników systemu, takich jak CoreDNS i metrics-server. 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ą przeznaczone głównie do hostowania zasobników aplikacji.
|
|
Gateway
|
Pule agentów bramy są przeznaczone do udostępniania statycznych adresów IP wychodzących zasobnikom. Aby uzyskać więcej informacji, zobacz https://aka.ms/aks/static-egress-gateway.
|
AgentPoolNetworkProfile
Objekt
Ustawienia sieciowe puli agentów.
| Nazwa |
Typ |
Opis |
|
allowedHostPorts
|
PortRange[]
|
Zakresy portów, które mogą umożliwić access. Określone zakresy mogą się nakładać.
|
|
applicationSecurityGroups
|
string[]
(arm-id)
|
Identyfikatory grup zabezpieczeń aplikacji, które pula agentów zostanie skojarzona podczas tworzenia.
|
|
dranet
|
DRANETProfile
|
Ustawienia DRANET puli agentów.
|
|
nodePublicIPTags
|
IPTag[]
|
IpTags publicznych adresów IP na poziomie wystąpienia.
|
AgentPoolSecurityProfile
Objekt
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 access SSH do puli agentów.
|
AgentPoolSSHAccess
Wyliczenie
Metoda access SSH do puli agentów.
| Wartość |
Opis |
|
LocalUser
|
Może połączyć się z węzłem przez SSH jako użytkownik lokalny przy użyciu klucza prywatnego.
|
|
Disabled
|
Usługa SSH zostanie wyłączona w węźle.
|
|
EntraId
|
Protokół SSH do węzła z integracją z EntraId. Więcej informacji można znaleźć w zakładce https://aka.ms/aks/ssh/aad
|
AgentPoolStatus
Objekt
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 błędzie. Jeśli nie wystąpił błąd, to pole zostanie pominięte.
|
AgentPoolType
Wyliczenie
Typ puli agentów.
| Wartość |
Opis |
|
VirtualMachineScaleSets
|
Utwórz pulę agentów wspieraną przez zestaw skalowania maszyn wirtualnych.
|
|
AvailabilitySet
|
Korzystanie z tego rozwiązania jest zdecydowanie odradzane.
|
|
VirtualMachines
|
Utwórz pulę agentów wspieraną przez tryb aranżacji pojedynczego wystąpienia maszyny wirtualnej.
|
AgentPoolUpgradeSettings
Objekt
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
Objekt
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.
|
ArtifactSource
Wyliczenie
Źródło artefaktu. Źródło, z którego są pobierane artefakty.
| Wartość |
Opis |
|
Cache
|
ściąganie obrazów z usługi Azure Container Registry z pamięcią podręczną
|
|
Direct
|
ściąganie obrazów z usługi Microsoft Artifact Registry
|
AutoScaleProfile
Objekt
Specyfikacje dotyczące automatycznego skalowania.
| Nazwa |
Typ |
Opis |
|
maxCount
|
integer
(int32)
|
Maksymalna liczba węzłów o określonych rozmiarach.
|
|
minCount
|
integer
(int32)
|
Minimalna liczba węzłów o określonych rozmiarach.
|
|
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".
|
AzureKeyVaultKms
Objekt
Ustawienia usługi zarządzania kluczami usługi Azure Key Vault dla profilu zabezpieczeń.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
enabled
|
boolean
|
|
Czy włączyć usługę zarządzania kluczami Azure Key Vault. Wartość domyślna to false.
|
|
keyId
|
string
|
|
Identyfikator klucza Azure Key Vault. Zobacz key identifier format po więcej szczegółów. Gdy usługa zarządzania kluczami Azure Key Vault jest włączona, to pole jest wymagane i musi być ważnym identyfikatorem klucza. Gdy usługa zarządzania kluczami Azure Key Vault jest wyłączona, pole zostaw puste.
|
|
keyVaultNetworkAccess
|
KeyVaultNetworkAccessTypes
|
Public
|
Sieciowe access key vault. Dostęp sieciowy do magazynu kluczy. Możliwe wartości to Public i Private.
Public oznacza, że key vault umożliwia publiczne access ze wszystkich sieci.
Private oznacza, że key vault wyłącza publiczne access i umożliwia private link. Wartość domyślna to Public.
|
|
keyVaultResourceId
|
string
(arm-id)
|
|
ID zasobu key vault. Jeśli parametr keyVaultNetworkAccess to Private, to pole jest wymagane i musi być prawidłowym identyfikatorem zasobu. Gdy parametr keyVaultNetworkAccess to Public, pozostaw pole puste.
|
BackendPoolType
Wyliczenie
Typ zarządzanego Load Balancer BackendPool zarządzanego ruchu przychodzącego.
ClusterUpgradeSettings
Objekt
Ustawienia uaktualniania klastra.
Code
Wyliczenie
Informuje, czy klaster jest uruchomiony, czy zatrzymany
| Wartość |
Opis |
|
Running
|
Klaster jest uruchomiony.
|
|
Stopped
|
Klaster jest zatrzymany.
|
ContainerNetworkLogs
Wyliczenie
Dozwolone wartości dla pobierania logów sieciowych kontenerów z Azure Monitor. Gdy Enabled, konkretne typy logów pobierane są kontrolowane przez powiązany CRD; domyślnie przyjmuje .Disabled Zobacz https://aka.ms/ContainerNetworkLogsDoc i https://aka.ms/acns/howtoenablecnl szczegóły.
| Wartość |
Opis |
|
Disabled
|
Azure monitor ingestion of container network logs is disabled
|
|
Enabled
|
Azure monitor włącza pobieranie logów sieciowych kontenerów
|
ContainerServiceLinuxProfile
Objekt
Profil maszyn wirtualnych z systemem Linux w klastrze usługi kontenera.
| Nazwa |
Typ |
Opis |
|
adminUsername
|
string
pattern: ^[A-Za-z][-A-Za-z0-9_]*$
|
Nazwa użytkownika administratora używana dla maszyn wirtualnych z systemem Linux.
|
|
ssh
|
ContainerServiceSshConfiguration
|
Konfiguracja SSH dla maszyn maszynowych opartych na Linuksie, działających na Azure.
|
ContainerServiceNetworkProfile
Objekt
Profil konfiguracji sieci.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
advancedNetworking
|
AdvancedNetworking
|
|
Zaawansowany profil sieci umożliwiający obserwowanie i pakiet funkcji zabezpieczeń w klastrze. Aby uzyskać więcej informacji, zobacz aka.ms/aksadvancednetworking.
|
|
dnsServiceIP
|
string
pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
|
10.0.0.10
|
Adres IP przypisany do usługi DNS Kubernetes. Musi znajdować się w zakresie adresów usługi Kubernetes określonym w usłudze ServiceCidr.
|
|
ipFamilies
|
IPFamily[]
|
|
Rodziny adresów IP używane do określania wersji adresów IP dostępnych dla klastra. Rodziny adresów IP służą do określania klastrów z jednym stosem lub dwoma stosami. W przypadku pojedynczego stosu oczekiwana wartość to IPv4. W przypadku dwóch stosów oczekiwane wartości to IPv4 i IPv6.
|
|
loadBalancerProfile
|
ManagedClusterLoadBalancerProfile
|
|
Profil klastra load balancer.
|
|
loadBalancerSku
|
LoadBalancerSku
|
|
Jednostka SKU modułu równoważenia obciążenia dla klastra zarządzanego. Wartość domyślna to "Standardowa". Zobacz Azure Load Balancer SKU aby uzyskać więcej informacji o różnicach między load balancer SKU.
|
|
natGatewayProfile
|
ManagedClusterNATGatewayProfile
|
|
Profil bramy translatora adresów sieciowych klastra.
|
|
networkDataplane
|
NetworkDataplane
|
|
Plan danych sieci używany w klastrze Kubernetes.
|
|
networkMode
|
NetworkMode
|
|
Tryb sieciowy, z którym skonfigurowany jest Azure CNI. Nie można tego określić, jeśli networkPlugin jest czymś innym niż 'azure'.
|
|
networkPlugin
|
NetworkPlugin
|
|
Wtyczka sieci używana do tworzenia sieci Kubernetes.
|
|
networkPluginMode
|
NetworkPluginMode
|
|
Tryb, który ma być używany przez wtyczkę sieci.
|
|
networkPolicy
|
NetworkPolicy
|
|
Zasady sieci używane do tworzenia sieci Kubernetes.
|
|
outboundType
|
OutboundType
|
loadBalancer
|
Metoda routingu ruchu wychodzącego (wychodzącego). Można to ustawić tylko w czasie tworzenia klastra i nie można go zmienić później. Więcej informacji można znaleźć w egress outbound type.
|
|
podCidr
|
string
pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$
|
10.244.0.0/16
|
Zakres adresów IP notacji CIDR, z którego można przypisać adresy IP zasobników podczas użycia rozwiązania kubenet.
|
|
podCidrs
|
string[]
|
|
Adres IP notacji CIDR zawiera zakresy adresów IP, z których mają zostać przypisane adresy IP zasobników. Oczekiwano jednej trasy CIDR protokołu IPv4 dla sieci z jednym stosem. Dla każdej rodziny adresów IP (IPv4/IPv6) są oczekiwane dwa elementy CIDRs, po jednej dla sieci z podwójnym stosem.
|
|
serviceCidr
|
string
pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$
|
10.0.0.0/16
|
Zakres adresów IP notacji CIDR, z którego chcesz przypisać adresy IP klastra usług. Nie może pokrywać się z żadnymi zakresami adresów IP podsieci.
|
|
serviceCidrs
|
string[]
|
|
Adres IP notacji CIDR zawiera zakresy adresów IP, z których należy przypisać adresy IP klastra usług. Oczekiwano jednej trasy CIDR protokołu IPv4 dla sieci z jednym stosem. Dla każdej rodziny adresów IP (IPv4/IPv6) są oczekiwane dwa elementy CIDRs, po jednej dla sieci z podwójnym stosem. Nie mogą nakładać się na żadne zakresy adresów IP podsieci.
|
|
staticEgressGatewayProfile
|
ManagedClusterStaticEgressGatewayProfile
|
|
Profil dodatku usługi Static Egress Gateway. Aby uzyskać więcej informacji na temat statycznej bramy ruchu wychodzącego, zobacz https://aka.ms/aks/static-egress-gateway.
|
ContainerServiceSshConfiguration
Objekt
Konfiguracja SSH dla maszyn wirtualnych opartych na Linuksie, działających na Azure.
| Nazwa |
Typ |
Opis |
|
publicKeys
|
ContainerServiceSshPublicKey[]
|
Lista kluczy publicznych SSH używanych do uwierzytelniania za pomocą maszyn wirtualnych opartych na systemie Linux. Można określić maksymalnie 1 klucz.
|
ContainerServiceSshPublicKey
Objekt
Zawiera informacje o danych klucza publicznego certyfikatu SSH.
| Nazwa |
Typ |
Opis |
|
keyData
|
string
|
Klucz publiczny certyfikatu używany do uwierzytelniania za pomocą maszyn wirtualnych za pośrednictwem protokołu SSH. Certyfikat musi być w formacie PEM z nagłówkami lub bez.
|
createdByType
Wyliczenie
Typ tożsamości, która utworzyła zasób.
| Wartość |
Opis |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
CreationData
Objekt
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.
|
DelegatedResource
Objekt
Właściwości delegowanego zasobu — tylko do użytku wewnętrznego.
| Nazwa |
Typ |
Opis |
|
location
|
string
|
Lokalizacja zasobu źródłowego — tylko do użytku wewnętrznego.
|
|
referralResource
|
string
|
Identyfikator delegowania delegowania odwołania (opcjonalnie) — tylko użycie wewnętrzne.
|
|
resourceId
|
string
|
Identyfikator zasobu usługi ARM delegowanego zasobu — tylko do użytku wewnętrznego.
|
|
tenantId
|
string
(uuid)
|
Identyfikator dzierżawy delegowanego zasobu — tylko do użytku wewnętrznego.
|
DRANETMode
Wyliczenie
Tryb DRANET dla puli agentów.
| Wartość |
Opis |
|
Unmanaged
|
DRANET nie jest zarządzany przez AKS.
|
|
Managed
|
DRANET jest zarządzany przez AKS.
|
DRANETProfile
Objekt
Ustawienia DRANET puli agentów.
| Nazwa |
Typ |
Opis |
|
mode
|
DRANETMode
|
Tryb DRANET dla puli agentów.
|
ErrorAdditionalInfo
Objekt
Dodatkowe informacje o błędzie zarządzania zasobami.
| Nazwa |
Typ |
Opis |
|
info
|
object
|
Dodatkowe informacje.
|
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorDetail
Objekt
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
|
Cel błędu.
|
ErrorResponse
Objekt
Odpowiedź na błąd
Expander
Wyliczenie
Ekspander do użycia podczas skalowania w górę. Jeśli nie zostanie określony, wartość domyślna to "losowe". Zobacz expanders aby uzyskać więcej informacji.
| Wartość |
Opis |
|
least-waste
|
Wybiera grupę węzłów, która będzie mieć najmniej bezczynny procesor CPU (jeśli jest powiązany, nieużywany pamięć) po skalowaniu w górę. Jest to przydatne, gdy masz różne klasy węzłów, na przykład wysokie użycie procesora CPU lub wysokie węzły pamięci i chcesz rozszerzyć je tylko wtedy, gdy są oczekujące zasobniki, które wymagają dużej ilości tych zasobów.
|
|
most-pods
|
Wybiera grupę węzłów, która będzie mogła zaplanować większość zasobników podczas skalowania w górę. Jest to przydatne, gdy używasz narzędzia nodeSelector, aby upewnić się, że niektóre zasobniki znajdują się w niektórych węzłach. Należy pamiętać, że nie spowoduje to wybrania większego węzła w porównaniu z mniejszymi węzłami, ponieważ może jednocześnie dodać wiele mniejszych węzłów.
|
|
priority
|
Wybiera grupę węzłów, która ma najwyższy priorytet przypisany przez użytkownika. Konfiguracja została opisana w więcej szczegółów tutaj.
|
|
random
|
Używane, gdy nie ma konkretnej potrzeby, aby grupy węzłów były skalowane inaczej.
|
ExtendedLocation
Objekt
Typ złożony lokalizacji rozszerzonej.
| Nazwa |
Typ |
Opis |
|
name
|
string
|
Nazwa lokalizacji rozszerzonej.
|
|
type
|
ExtendedLocationTypes
|
Typ lokalizacji rozszerzonej.
|
ExtendedLocationTypes
Wyliczenie
Typ extendedLocation.
| Wartość |
Opis |
|
EdgeZone
|
Azure Edge Zone extended location type.
|
GatewayAPIIstioEnabled
Wyliczenie
Czy włączyć Istio jako implementację API bramy dla zarządzanego wejścia z pomocą trasowania aplikacji.
| Wartość |
Opis |
|
Enabled
|
Umożliwia zarządzane wejście przez Gateway API za pomocą bezbocznej płaszczyzny sterującej Istio.
|
|
Disabled
|
Wyłącza płaszczyznę sterowania istio bez sidecara dla zarządzanego wejścia przez API Gateway.
|
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
|
Profil instancji GPU MIG 1g.
|
|
MIG2g
|
Profil instancji MIG 2G GPU.
|
|
MIG3g
|
Profil instancji GPU MIG 3G.
|
|
MIG4g
|
Profil instancji MIG 4G GPU.
|
|
MIG7g
|
Profil instancji GPU MIG 7g.
|
GPUProfile
Objekt
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).
|
IPFamily
Wyliczenie
Aby określić, czy adres należy do rodziny IPv4 czy IPv6
| Wartość |
Opis |
|
IPv4
|
Rodzina IPv4
|
|
IPv6
|
Rodzina IPv6
|
IPTag
Objekt
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.
|
IstioCertificateAuthority
Objekt
Konfiguracja urzędu certyfikacji usługi Istio Service Mesh. Na razie obsługujemy tylko certyfikaty wtyczek zgodnie z opisem w tym miejscu https://aka.ms/asm-plugin-ca
IstioComponents
Objekt
Konfiguracja składników istio.
IstioEgressGateway
Objekt
Konfiguracja bramy ruchu wychodzącego Istio.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć bramę ruchu wychodzącego.
|
|
gatewayConfigurationName
|
string
|
Nazwa zasobu niestandardowego konfiguracji bramy dla bramy ruchu wychodzącego dodatku Istio. Należy określić podczas włączania bramy ruchu wychodzącego Istio. Należy wdrożyć w tej samej przestrzeni nazw, w których zostanie wdrożona brama ruchu wychodzącego Istio.
|
|
name
|
string
pattern: [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
|
Nazwa bramy ruchu wychodzącego dodatku Istio.
|
|
namespace
|
string
|
Przestrzeń nazw, w ramach którego powinna zostać wdrożona brama ruchu wychodzącego dodatku Istio. Jeśli nie określono, wartość domyślna to aks-istio-egress.
|
IstioIngressGateway
Objekt
Konfiguracja bramy ruchu przychodzącego istio. Na razie obsługujemy maksymalnie jedną zewnętrzną bramę ruchu przychodzącego o nazwie aks-istio-ingressgateway-external i jedną wewnętrzną bramę ruchu przychodzącego o nazwie aks-istio-ingressgateway-internal.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć bramę ruchu przychodzącego.
|
|
mode
|
IstioIngressGatewayMode
|
Tryb bramy ruchu przychodzącego.
|
IstioIngressGatewayMode
Wyliczenie
Tryb bramy ruchu przychodzącego.
| Wartość |
Opis |
|
External
|
Brama ruchu przychodzącego ma przypisany publiczny adres IP i jest publicznie dostępna.
|
|
Internal
|
Brama ruchu przychodzącego jest przypisywana do wewnętrznego adresu IP i nie można uzyskać do niego dostępu publicznie.
|
IstioPluginCertificateAuthority
Objekt
Informacje o certyfikatach wtyczki dla usługi Service Mesh.
| Nazwa |
Typ |
Opis |
|
certChainObjectName
|
string
|
Nazwa obiektu łańcucha certyfikatów w Azure Key Vault.
|
|
certObjectName
|
string
|
Nazwa obiektu certyfikatu pośredniego w usłudze Azure Key Vault.
|
|
keyObjectName
|
string
|
Nazwa obiektu klucza prywatnego certyfikatu pośredniego w usłudze Azure Key Vault.
|
|
keyVaultId
|
string
(arm-id)
|
ID zasobu Key Vault.
|
|
rootCertObjectName
|
string
|
Nazwa obiektu certyfikatu root in Azure Key Vault.
|
IstioServiceMesh
Objekt
Konfiguracja siatki usługi Istio.
KeyVaultNetworkAccessTypes
Wyliczenie
Sieciowe access key vault. Dostęp sieciowy do magazynu kluczy. Możliwe wartości to Public i Private.
Public oznacza, że key vault umożliwia publiczne access ze wszystkich sieci.
Private oznacza, że key vault wyłącza publiczne access i umożliwia private link. Wartość domyślna to Public.
| Wartość |
Opis |
|
Public
|
Key vault umożliwia publiczny dostęp ze wszystkich sieci.
|
|
Private
|
Key vault wyłącza dostęp publiczny i umożliwia prywatne łącze.
|
KubeletConfig
Objekt
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 osiągnięciu którego usuwanie zbędnych obrazów jest zawsze uruchamiane. Aby wyłączyć zbieranie nieużywanych obrazów, ustaw wartość na 100. Wartość domyślna to 85%
|
|
imageGcLowThreshold
|
integer
(int32)
|
Procent użycia dysku, poniżej którego nigdy nie jest uruchamiane czyszczenie nieużywanych danych obrazu. 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 rozmieszczenie woluminów emptyDir, root danych w czasie rzeczywistym kontenera oraz ephemeral storage Kubeleta.
| Wartość |
Opis |
|
OS
|
Platforma Kubelet będzie używać dysku systemu operacyjnego dla swoich danych.
|
|
Temporary
|
Platforma Kubelet będzie używać dysku tymczasowego dla swoich danych.
|
KubernetesSupportPlan
Wyliczenie
Różne warstwy pomocy technicznej dla klastrów zarządzanych przez usługę AKS
| Wartość |
Opis |
|
KubernetesOfficial
|
Obsługa wersji jest taka sama jak w przypadku oferty kubernetes typu open source. Oficjalne wersje wsparcia społeczności open source Kubernetes przez rok po wydaniu.
|
|
AKSLongTermSupport
|
Obsługa wersji rozszerzonej w przeszłości wsparcia platformy KubernetesOfficial przez 1 rok. Usługa AKS nadal poprawia CVEs przez kolejny 1 rok, przez łącznie 2 lata wsparcia.
|
LicenseType
Wyliczenie
Typ licencji do użycia dla maszyn wirtualnych z systemem Windows. Zobacz Azure Korzyści dla Hybrydowych Użytkowników aby uzyskać więcej szczegółów.
| Wartość |
Opis |
|
None
|
Nie zastosowano żadnych dodatkowych licencji.
|
|
Windows_Server
|
Umożliwia korzystanie z korzyści użycia hybrydowego użytkownika platformy Azure dla maszyn wirtualnych z systemem Windows.
|
LinuxOSConfig
Objekt
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.
|
LoadBalancerSku
Wyliczenie
Jednostka SKU modułu równoważenia obciążenia dla klastra zarządzanego. Wartość domyślna to "Standardowa". Zobacz Azure Load Balancer SKU aby uzyskać więcej informacji o różnicach między load balancer SKU.
| Wartość |
Opis |
|
standard
|
Użyj standardowego Load Balancer. To jest zalecana wersja Load Balancer SKU. Więcej informacji o pracy z load balancer w zarządzanym klastrze można znaleźć w artykule standard Load Balancer.
|
|
basic
|
Użyj podstawowego Load Balancer o ograniczonej funkcjonalności.
|
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
Objekt
Przesłonięcia dla profilu localDNS.
| Nazwa |
Typ |
Domyślna wartość |
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
Objekt
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 |
Domyślna wartość |
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.
|
ManagedCluster
Objekt
Klaster zarządzany.
| Nazwa |
Typ |
Opis |
|
eTag
|
string
|
Jeśli element eTag jest podany w treści odpowiedzi, może być również podany jako nagłówek zgodnie z normalną konwencją etag. Tagi jednostek są używane do porównywania co najmniej dwóch jednostek z tego samego żądanego zasobu. Protokół HTTP/1.1 używa tagów jednostek w elemecie etag (sekcja 14.19), If-Match (sekcja 14.24), if-None-Match (sekcja 14.26) i If-Range (sekcja 14.27) pól nagłówka.
|
|
extendedLocation
|
ExtendedLocation
|
Rozszerzona lokalizacja maszyny wirtualnej.
|
|
id
|
string
(arm-id)
|
W pełni określony identyfikator zasobu dla tego zasobu. Np. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
ManagedClusterIdentity
|
Tożsamość klastra zarządzanego, jeśli jest skonfigurowana.
|
|
kind
|
string
|
Jest to używane głównie do uwidaczniania różnych środowisk interfejsu użytkownika w portalu dla różnych rodzajów
|
|
location
|
string
|
Lokalizacja geograficzna, w której znajduje się zasób
|
|
name
|
string
|
Nazwa zasobu
|
|
properties.aadProfile
|
ManagedClusterAADProfile
|
Konfiguracja Azure Active Directory.
|
|
properties.addonProfiles
|
<string,
ManagedClusterAddonProfile>
|
Profil dodatku klastra zarządzanego.
|
|
properties.agentPoolProfiles
|
ManagedClusterAgentPoolProfile[]
|
Właściwości puli agentów.
|
|
properties.aiToolchainOperatorProfile
|
ManagedClusterAIToolchainOperatorProfile
|
Ustawienia operatora łańcucha narzędzi sztucznej inteligencji, które mają zastosowanie do całego klastra.
|
|
properties.apiServerAccessProfile
|
ManagedClusterAPIServerAccessProfile
|
Profil access dla zarządzanego serwera API klastra.
|
|
properties.autoScalerProfile
|
ManagedClusterPropertiesAutoScalerProfile
|
Parametry, które mają być stosowane do skalowania automatycznego klastra po włączeniu
|
|
properties.autoUpgradeProfile
|
ManagedClusterAutoUpgradeProfile
|
Konfiguracja automatycznego uaktualniania.
|
|
properties.azureMonitorProfile
|
ManagedClusterAzureMonitorProfile
|
Profile dodatków Azure Monitor do monitorowania zarządzanego klastra.
|
|
properties.azurePortalFQDN
|
string
|
Specjalny FQDN używany przez Azure Portal do dostępu do Managed Cluster. Ten FQDN jest przeznaczony wyłącznie dla Azure Portal i nie powinien być używany przez innych klientów. Azure Portal wymaga wysyłania określonych nagłówków Cross-Origin Resource Sharing (CORS) w niektórych odpowiedziach, czego Kubernetes APIServer domyślnie nie obsługuje. Ten specjalny FQDN obsługuje CORS, pozwalając na prawidłowe działanie Azure Portal.
|
|
properties.bootstrapProfile
|
ManagedClusterBootstrapProfile
|
Profil konfiguracji uruchamiania klastra.
|
|
properties.currentKubernetesVersion
|
string
|
Wersja rozwiązania Kubernetes, na którym działa klaster zarządzany. Jeśli parametr kubernetesVersion był w pełni określoną wersją <główna.pomocnicza.patch>, to pole będzie dokładnie równe. Jeśli parametr kubernetesVersion został <wersja główna.pomocnicza>, to pole będzie zawierać pełną <wersji głównej.pomocnicza.patch>.
|
|
properties.disableLocalAccounts
|
boolean
|
Jeśli konta lokalne powinny być wyłączone w klastrze zarządzanym. Jeśli ustawiono wartość true, pobieranie poświadczeń statycznych zostanie wyłączone dla tego klastra. Należy go używać tylko w klastrach zarządzanych z włączoną usługą AAD. Więcej szczegółów można znaleźć w wyłącz konta lokalne.
|
|
properties.diskEncryptionSetID
|
string
(arm-id)
|
Identyfikator zasobu szyfrowania dysku ustawiony na potrzeby włączania szyfrowania magazynowanych. Jest to forma: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}"
|
|
properties.dnsPrefix
|
string
|
Prefiks DNS klastra zarządzanego. Nie można go zaktualizować po utworzeniu klastra zarządzanego.
|
|
properties.enableRBAC
|
boolean
|
Czy włączyć Kubernetes Role-Based Access Control.
|
|
properties.fqdn
|
string
|
Nazwa FQDN puli głównej.
|
|
properties.fqdnSubdomain
|
string
|
Poddomena nazwy FQDN klastra prywatnego z niestandardową prywatną strefą DNS. Nie można go zaktualizować po utworzeniu klastra zarządzanego.
|
|
properties.hostedSystemProfile
|
ManagedClusterHostedSystemProfile
|
Ustawienia hostowanych dodatków systemowych. Aby uzyskać więcej informacji, zobacz https://aka.ms/aks/automatic/systemcomponents.
|
|
properties.httpProxyConfig
|
ManagedClusterHTTPProxyConfig
|
Konfiguracje aprowizowania klastra za pomocą serwerów proxy HTTP.
|
|
properties.identityProfile
|
<string,
UserAssignedIdentity>
|
Tożsamość użytkownika skojarzona z klastrem zarządzanym. Ta tożsamość będzie używana przez narzędzie kubelet. Dozwolona jest tylko jedna tożsamość przypisana przez użytkownika. Jedynym akceptowanym kluczem jest "kubeletidentity", z wartością "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".
|
|
properties.ingressProfile
|
ManagedClusterIngressProfile
|
Profil ruchu przychodzącego dla klastra zarządzanego.
|
|
properties.kubernetesVersion
|
string
|
Wersja platformy Kubernetes określona przez użytkownika. Obsługiwane są obie wersje poprawki <major.minor.patch> (np. 1.20.13) i <główna.pomocnicza> (np. 1.20). Po <określeniu wersji major.minor> jest wybierana automatycznie najnowsza obsługiwana wersja poprawki ogólnie dostępnej. Aktualizacja klastra o tej samej <wersji głównej.pomocnicza> po utworzeniu klastra (np. 1.14.x –> 1.14) nie spowoduje wyzwolenia uaktualnienia, nawet jeśli jest dostępna nowsza wersja poprawki. Podczas uaktualniania obsługiwanego klastra usługi AKS nie można pominąć wersji pomocniczych platformy Kubernetes. Wszystkie uaktualnienia muszą zostać wykonane w kolejności według numeru wersji głównej. Na przykład uaktualnienia z zakresu 1.14.x —> 1.15.x lub 1.15.x —> 1.16.x są dozwolone, jednak wersja 1.14.x —> 1.16.x jest niedozwolona. Zobacz ulepszenie klastra AKS po więcej szczegółów.
|
|
properties.linuxProfile
|
ContainerServiceLinuxProfile
|
Profil maszyn wirtualnych z systemem Linux w klastrze zarządzanym.
|
|
properties.maxAgentPools
|
integer
(int32)
|
Maksymalna liczba pul agentów dla klastra zarządzanego.
|
|
properties.metricsProfile
|
ManagedClusterMetricsProfile
|
Opcjonalna konfiguracja metryk klastra.
|
|
properties.networkProfile
|
ContainerServiceNetworkProfile
|
Profil konfiguracji sieci.
|
|
properties.nodeProvisioningProfile
|
ManagedClusterNodeProvisioningProfile
|
Ustawienia aprowizacji węzła, które mają zastosowanie do całego klastra.
|
|
properties.nodeResourceGroup
|
string
|
Nazwa grupy zasobów zawierającej węzły puli agentów.
|
|
properties.nodeResourceGroupProfile
|
ManagedClusterNodeResourceGroupProfile
|
Profil konfiguracji grupy zasobów węzła.
|
|
properties.oidcIssuerProfile
|
ManagedClusterOIDCIssuerProfile
|
Profil wystawcy OIDC klastra zarządzanego.
|
|
properties.podIdentityProfile
|
ManagedClusterPodIdentityProfile
|
Profil tożsamości zasobnika klastra zarządzanego. Zobacz use AAD pod identity aby uzyskać więcej szczegółów na temat integracji z tożsamością AAD.
|
|
properties.powerState
|
PowerState
|
Stan zasilania klastra.
|
|
properties.privateFQDN
|
string
|
Nazwa FQDN klastra prywatnego.
|
|
properties.privateLinkResources
|
PrivateLinkResource[]
|
Private link zasobów powiązanych z klastrem.
|
|
properties.provisioningState
|
string
|
Bieżący stan aprowizacji.
|
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
PublicNetworkAccess klastra zarządzanego. Zezwalaj lub odmawiaj access do sieci publicznej dla AKS
|
|
properties.resourceUID
|
string
|
Identyfikator resourceUID jednoznacznie identyfikuje klastry zarządzane, które ponownie używają identyfikatorów zasobów usługi ARM (tj. tworzenie, usuwanie, tworzenie sekwencji)
|
|
properties.schedulerProfile
|
SchedulerProfile
|
Profil z ustawieniami związanymi z harmonogramem, takimi jak tryb konfiguracji dla każdego planisty zarządzany przez AKS. Zobacz: https://aka.ms/aks/scheduler-profile.
|
|
properties.securityProfile
|
ManagedClusterSecurityProfile
|
Profil zabezpieczeń klastra zarządzanego.
|
|
properties.serviceMeshProfile
|
ServiceMeshProfile
|
Profil usługi Service Mesh dla klastra zarządzanego.
|
|
properties.servicePrincipalProfile
|
ManagedClusterServicePrincipalProfile
|
Informacje o tożsamości głównej usługi dla klastra do manipulacji API Azure.
|
|
properties.status
|
ManagedClusterStatus
|
Zawiera informacje tylko do odczytu dotyczące klastra zarządzanego.
|
|
properties.storageProfile
|
ManagedClusterStorageProfile
|
Storage profile dla zarządzanego klastra.
|
|
properties.supportPlan
|
KubernetesSupportPlan
|
Plan pomocy technicznej dla klastra zarządzanego. Jeśli nie określono, wartość domyślna to "KubernetesOfficial".
|
|
properties.upgradeSettings
|
ClusterUpgradeSettings
|
Ustawienia uaktualniania klastra.
|
|
properties.windowsProfile
|
ManagedClusterWindowsProfile
|
Profil maszyn wirtualnych z systemem Windows w klastrze zarządzanym.
|
|
properties.workloadAutoScalerProfile
|
ManagedClusterWorkloadAutoScalerProfile
|
Profil automatycznego skalowania obciążenia dla klastra zarządzanego.
|
|
sku
|
ManagedClusterSKU
|
Jednostka SKU klastra zarządzanego.
|
|
systemData
|
systemData
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
|
tags
|
object
|
Tagi zasobów.
|
|
type
|
string
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
ManagedClusterAADProfile
Objekt
AADProfile określa atrybuty integracji z Azure Active Directory. Aby uzyskać więcej informacji, zobacz managed AAD on AKS.
| Nazwa |
Typ |
Opis |
|
adminGroupObjectIDs
|
string[]
|
Lista identyfikatorów obiektów grupy usługi AAD, które będą miały rolę administratora klastra.
|
|
clientAppID
|
string
|
(PRZESTARZAŁE) Identyfikator aplikacji usługi AAD klienta. Dowiedz się więcej na stronie https://aka.ms/aks/aad-legacy.
|
|
enableAzureRBAC
|
boolean
|
Czy włączyć Azure kontrolę dostępu opartą na rolach na potrzeby autoryzacji platformy Kubernetes.
|
|
managed
|
boolean
|
Czy włączyć zarządzaną usługę AAD.
|
|
serverAppID
|
string
|
(PRZESTARZAŁE) Identyfikator aplikacji usługi AAD serwera. Dowiedz się więcej na stronie https://aka.ms/aks/aad-legacy.
|
|
serverAppSecret
|
string
(password)
|
(PRZESTARZAŁE) Wpis tajny aplikacji usługi AAD serwera. Dowiedz się więcej na stronie https://aka.ms/aks/aad-legacy.
|
|
tenantID
|
string
|
Identyfikator dzierżawy usługi AAD do użycia do uwierzytelniania. Jeśli nie zostanie określony, użyje dzierżawy subskrypcji wdrożenia.
|
ManagedClusterAddonProfile
Objekt
Profil dodatku Kubernetes dla klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
config
|
object
|
Pary klucz-wartość do konfigurowania dodatku.
|
|
enabled
|
boolean
|
Czy dodatek jest włączony, czy nie.
|
|
identity
|
ManagedClusterAddonProfileIdentity
|
Informacje o tożsamości przypisanej przez użytkownika używanej przez ten dodatek.
|
ManagedClusterAddonProfileIdentity
Objekt
Informacje o tożsamości przypisanej przez użytkownika używanej przez ten dodatek.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
|
Identyfikator klienta tożsamości przypisanej przez użytkownika.
|
|
objectId
|
string
|
Identyfikator obiektu tożsamości przypisanej przez użytkownika.
|
|
resourceId
|
string
(arm-id)
|
Identyfikator zasobu tożsamości przypisanej przez użytkownika.
|
ManagedClusterAgentPoolProfile
Objekt
Profil puli agentów usługi kontenera.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
artifactStreamingProfile
|
AgentPoolArtifactStreamingProfile
|
|
Konfiguracja używania przesyłania strumieniowego artefaktów w usłudze AKS.
|
|
availabilityZones
|
string[]
|
|
Lista Availability zones do wykorzystania dla węzłów. Można to określić tylko wtedy, gdy właściwość AgentPoolType to "VirtualMachineScaleSets".
|
|
capacityReservationGroupID
|
string
(arm-id)
|
|
W pełni kwalifikowany ID zasobu Grupy Rezerwacji Pojemności, umożliwiający dostarczanie virtual machines z zarezerwowanej grupy Virtual Machines. Ma ona formę: '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' Klienci używają jej do tworzenia puli agentów z określonym CRG. Więcej informacji można znaleźć w Rezerwacja przepustowości
|
|
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.
|
|
creationData
|
CreationData
|
|
CreationData do określenia źródłowego identyfikatora migawki, jeśli pula węzłów zostanie utworzona/uaktualniona przy użyciu migawki.
|
|
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.
|
|
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.
|
|
enableAutoScaling
|
boolean
|
|
Czy włączyć automatyczne skalowanie
|
|
enableEncryptionAtHost
|
boolean
|
|
Czy włączyć szyfrowanie dysków danych i systemu operacyjnego opartego na hoście. Jest to obsługiwane tylko na określonych rozmiarach maszyn wirtualnych i w niektórych regionach Azure. Aby uzyskać więcej informacji, zobacz: https://docs.microsoft.com/azure/aks/enable-host-encryption
|
|
enableFIPS
|
boolean
|
|
Czy używać systemu operacyjnego z obsługą protokołu FIPS. Zobacz Dodaj pulę węzłów z FIPS-em aby uzyskać więcej szczegółów.
|
|
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. Więcej informacji można znaleźć w przypisywanie publicznego IP dla węzła. Wartość domyślna to false.
|
|
enableUltraSSD
|
boolean
|
|
Czy włączyć warstwę UltraSSD
|
|
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ą.
|
|
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.
|
|
gpuProfile
|
GPUProfile
|
|
Ustawienia procesora GPU dla puli agentów.
|
|
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}. Więcej informacji można znaleźć w Azure dedykowane hosty.
|
|
kubeletConfig
|
KubeletConfig
|
|
Konfiguracja rozwiązania Kubelet w węzłach puli agentów.
|
|
kubeletDiskType
|
KubeletDiskType
|
|
Określa rozmieszczenie woluminów emptyDir, root danych w czasie rzeczywistym kontenera oraz ephemeral storage Kubeleta.
|
|
linuxOSConfig
|
LinuxOSConfig
|
|
Konfiguracja systemu operacyjnego węzłów agenta systemu Linux.
|
|
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.
|
|
maxCount
|
integer
(int32)
|
|
Maksymalna liczba węzłów do automatycznego skalowania
|
|
maxPods
|
integer
(int32)
|
|
Maksymalna liczba zasobników, które mogą być uruchamiane w węźle.
|
|
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 Windows. Musi to być ciąg statyczny (tj. zostanie wydrukowany jako nieprzetworzone i nie zostanie wykonany jako skrypt).
|
|
minCount
|
integer
(int32)
|
|
Minimalna liczba węzłów do automatycznego skalowania
|
|
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
|
|
name
|
string
pattern: ^[a-z][a-z0-9]{0,11}$
|
|
Unikatowa nazwa profilu puli agentów w kontekście subskrypcji i grupy zasobów. Nazwy puli agentów systemu Windows muszą zawierać co najmniej 6 znaków.
|
|
networkProfile
|
AgentPoolNetworkProfile
|
|
Ustawienia związane z siecią puli agentów.
|
|
nodeImageVersion
|
string
|
|
Wersja obrazu węzła. Ustawienie tej wartości wywołuje rollback agentPool.
Dozwolone są tylko wartości z .recentlyUsedVersions
|
|
nodeLabels
|
object
|
|
Etykiety węzłów, które mają być utrwalane we wszystkich węzłach w puli agentów.
|
|
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}
|
|
nodeTaints
|
string[]
|
|
Defekty dodane do nowych węzłów podczas tworzenia i skalowania puli węzłów. Na przykład key=value:NoSchedule.
|
|
orchestratorVersion
|
string
|
|
Wersja platformy Kubernetes określona przez użytkownika. Obsługiwane są obie wersje poprawki <major.minor.patch> (np. 1.20.13) i <główna.pomocnicza> (np. 1.20). Po <określeniu wersji major.minor> jest wybierana automatycznie najnowsza obsługiwana wersja poprawki ogólnie dostępnej. Aktualizacja klastra o tej samej <wersji głównej.pomocnicza> po utworzeniu klastra (np. 1.14.x –> 1.14) nie spowoduje wyzwolenia 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. Więcej informacji można znaleźć w upgrading a node pool.
|
|
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.
|
|
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. Więcej informacji można znaleźć w Ephemeral OS.
|
|
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 Kubernetes <>= 1.25, jeśli typ systemu operacyjnego to Windows.
|
|
osType
|
OSType
|
Linux
|
Typ systemu operacyjnego. Wartość domyślna to Linux.
|
|
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".
|
|
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}
|
|
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
|
|
provisioningState
|
string
|
|
Bieżący stan wdrożenia lub aprowizacji.
|
|
proximityPlacementGroupID
|
string
(arm-id)
|
|
Identyfikator grupy umieszczania w pobliżu.
|
|
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ń.
|
|
scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Delete
|
Zasady eksmisji zestawu skalowania maszyn wirtualnych. Polityka eksmisji określa, co to do VM po jego eksmitacji. Wartość domyślna to Usuń. Więcej informacji o eksmisji można znaleźć w spot VMs
|
|
scaleSetPriority
|
ScaleSetPriority
|
Regular
|
Priorytet zestawu skalowania maszyn wirtualnych.
|
|
securityProfile
|
AgentPoolSecurityProfile
|
|
Ustawienia zabezpieczeń puli agentów.
|
|
spotMaxPrice
|
number
(float)
|
-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. Więcej szczegółów na temat cen spot znajdziesz w spot VMs pricing
|
|
status
|
AgentPoolStatus
|
|
Zawiera informacje tylko do odczytu dotyczące puli agentów.
|
|
tags
|
object
|
|
Tagi, które mają być utrwalane w zestawie skalowania maszyn wirtualnych puli agentów.
|
|
type
|
AgentPoolType
|
|
Typ puli agentów.
|
|
upgradeSettings
|
AgentPoolUpgradeSettings
|
|
Ustawienia uaktualniania puli agentów
|
|
virtualMachineNodesStatus
|
VirtualMachineNodes[]
|
|
Stan węzłów w puli agentów VirtualMachines.
|
|
virtualMachinesProfile
|
VirtualMachinesProfile
|
|
Specyfikacje w puli agentów VirtualMachines.
|
|
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
|
|
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}
|
|
windowsProfile
|
AgentPoolWindowsProfile
|
|
Określony profil puli agentów systemu Windows.
|
|
workloadRuntime
|
WorkloadRuntime
|
|
Określa typ obciążenia, który może uruchomić węzeł.
|
Objekt
Po włączeniu operatora w klastrze zostanie zainstalowany zestaw zarządzanych identyfikatorów CRD i kontrolerów usługi AKS. Operator automatyzuje wdrażanie modeli systemu operacyjnego na potrzeby wnioskowania i/lub trenowania. Zapewnia zestaw wstępnie ustawionych modeli i umożliwia rozproszone wnioskowanie względem nich.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Określa, czy włączyć operatora łańcucha narzędzi sztucznej inteligencji w klastrze. Wskazuje, czy operator łańcucha narzędzi sztucznej inteligencji jest włączony, czy nie.
|
ManagedClusterAPIServerAccessProfile
Objekt
Profil dostępu dla serwera interfejsu API klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
authorizedIPRanges
|
string[]
|
Zakresy adresów IP autoryzowane do uzyskiwania dostępu do serwera interfejsu API Kubernetes. Zakresy adresów IP są określane w formacie CIDR, np. 137.117.106.88/29. Ta funkcja nie jest kompatybilna z klastrami korzystającymi z Public IP Per Node ani klastrami korzystającymi z Basic Load Balancer. Więcej informacji można znaleźć w API autoryzowane zakresy IP serwera.
|
|
disableRunCommand
|
boolean
|
Czy wyłączyć uruchamianie polecenia dla klastra, czy nie.
|
|
enablePrivateCluster
|
boolean
|
Czy klaster ma zostać utworzony jako klaster prywatny, czy nie. Więcej szczegółów można znaleźć w Tworzenie prywatnego klastra AKS.
|
|
enablePrivateClusterPublicFQDN
|
boolean
|
Czy utworzyć dodatkową publiczną nazwę FQDN dla klastra prywatnego, czy nie.
|
|
enableVnetIntegration
|
boolean
|
Czy włączyć integrację z siecią wirtualną apiserver dla klastra, czy nie. Zobacz aka.ms/AksVnetIntegration, aby uzyskać więcej informacji.
|
|
privateDNSZone
|
string
|
Prywatny tryb strefy DNS dla klastra. Wartość domyślna to System. Więcej szczegółów można znaleźć w configure private DNS zone. Dozwolone wartości to "system" i "none".
|
|
subnetId
|
string
(arm-id)
|
Podsieć, która ma być używana, gdy jest włączona integracja z siecią wirtualną apiserver. Jest to wymagane podczas tworzenia nowego klastra z siecią wirtualną BYO lub podczas aktualizowania istniejącego klastra w celu włączenia integracji z siecią wirtualną serwera apiserver.
|
ManagedClusterAppRoutingIstio
Objekt
Konfiguracja do użycia płaszczyzny sterującej Istio bez sidecarów do zarządzanego wejścia za pośrednictwem API Gateway z routowaniem aplikacji. Zobacz https://aka.ms/gateway-on-istio informacje o wykorzystaniu Istio do wejścia przez API bramy.
| Nazwa |
Typ |
Opis |
|
mode
|
GatewayAPIIstioEnabled
|
Czy włączyć Istio jako implementację API bramy dla zarządzanego wejścia z pomocą trasowania aplikacji.
|
ManagedClusterAutoUpgradeProfile
Objekt
Profil automatycznego uaktualniania dla klastra zarządzanego.
ManagedClusterAzureMonitorProfile
Objekt
Profile dodatków Azure Monitor do monitorowania zarządzanego klastra.
| Nazwa |
Typ |
Opis |
|
appMonitoring
|
ManagedClusterAzureMonitorProfileAppMonitoring
|
Profil monitorowania aplikacji dla kontenera aplikacji Kubernetes. Zbiera logi aplikacji, metryki i śledzenia poprzez autoinstrumentację aplikacji przy użyciu SDK opartych na Azure Monitor OpenTelemetry. Aby zapoznać się z omówieniem, zobacz aka.ms/AzureMonitorApplicationMonitoring.
|
|
containerInsights
|
ManagedClusterAzureMonitorProfileContainerInsights
|
Ustaw to, aby włączyć i skonfigurować Azure Monitor Container Insights dla klastra, który zbiera zdarzenia, inventory oraz logi stdout & stderr Kubernetes. Zobacz aka.ms/AzureMonitorContainerInsights, aby zapoznać się z omówieniem.
|
|
metrics
|
ManagedClusterAzureMonitorProfileMetrics
|
Profil metryki dla Azure Monitor managed service for Prometheus addon. Zbieraj gotowe metryki infrastruktury Kubernetes, które wysyłasz do Azure Monitor Workspace i konfiguruj dodatkowe scraping dla niestandardowych celów. Aby zapoznać się z omówieniem, zobacz aka.ms/AzureManagedPrometheus.
|
ManagedClusterAzureMonitorProfileAppMonitoring
Objekt
Profil monitorowania aplikacji dla AKS.
ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation
Objekt
Monitorowanie aplikacji do autoinstrumentacji dla AKS. Wdraża webhook, który automatycznie uruchamia obciążenia z dystrybucjami Microsoft OpenTelemetry do zbierania metryk, logów i śledzeń OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Wskazuje, czy Auto-instrumentacja monitorowania aplikacji jest włączona, czy nie.
|
ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsAndTraces
Objekt
Monitorowanie aplikacji OpenTelemetry logi i profile śledzeń dla AKS. Zbiera logi OpenTelemetry i ślady aplikacji za pomocą SDK opartych na Azure Monitor OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Wskazuje, czy monitoring aplikacji OpenTelemetry Logs and Traces jest włączony, czy nie.
|
|
grpcPort
|
integer
(int64)
|
Port hosta dla logów i śladów OpenTelemetry GRPC. Jeśli nie jest to określone, domyślny port to 28332.
|
|
httpPort
|
integer
(int64)
|
Port hosta dla OpenTelemetry HTTP/PROTOBUF loguje i śledzi się. Jeśli nie zostanie określony, domyślny port to 28331.
|
ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics
Objekt
Monitorowanie aplikacji OpenTelemetry Metrics Profile dla AKS. Zbiera metryki OpenTelemetry aplikacji za pomocą SDK opartych na Azure Monitor OpenTelemetry. Zobacz https://aka.ms/AKSAppMonitoringDocs i https://aka.ms/AzureMonitorApplicationMonitoring po przegląd.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Wskazuje, czy metryki OpenTelemetry Monitoring Aplikacji są włączone, czy nie.
|
|
grpcPort
|
integer
(int64)
|
Port hosta dla metryk OpenTelemetry GRPC. Jeśli nie jest to określone, domyślny port to 28334.
|
|
httpPort
|
integer
(int64)
|
Port hosta dla metryk OpenTelemetry HTTP/PROTOBUF. Jeśli nie zostanie określony, domyślny port to 28333.
|
ManagedClusterAzureMonitorProfileContainerInsights
Objekt
Azure Monitor Container Insights profile. Reprezentuje konfigurację zbierania zdarzeń Kubernetes, inwentarza oraz rejestrów stdout i stderr w kontenerach. Zobacz aka.ms/AzureMonitorContainerInsights, aby zapoznać się z omówieniem.
| Nazwa |
Typ |
Opis |
|
containerNetworkLogs
|
ContainerNetworkLogs
|
Conconfigure container network logs ingestion with Azure Monitor. Typy logów pobieranych są kontrolowane przez powiązany CRD; jeśli nie jest określone, domyślnie przyjmuje .Disabled Zobacz https://aka.ms/ContainerNetworkLogsDoc i https://aka.ms/acns/howtoenablecnl szczegóły.
|
|
disablePrometheusMetricsScraping
|
boolean
|
Wskazuje, czy złomowanie metryk prometheus jest wyłączone, czy nie. Jeśli nie jest to określone, domyślny jest fałszywy, czyli umożliwia skrząpanie Prometeusza.
|
|
enabled
|
boolean
|
Wskazuje, czy dodatek Azure Monitor Container Insights Logs jest włączony, czy nie.
|
|
logAnalyticsWorkspaceResourceId
|
string
(arm-id)
|
Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor container Insights Logs.
|
|
syslogPort
|
integer
(int64)
|
Port hosta dziennika systemowego. Jeśli nie zostanie określony, domyślny port to 28330.
|
ManagedClusterAzureMonitorProfileKubeStateMetrics
Objekt
Kube State Metrics profile dla Azure Managed Prometheus addon. Te opcjonalne ustawienia dotyczą zasobnika kube-state-metrics wdrożonego za pomocą dodatku. Aby uzyskać szczegółowe informacje, zobacz aka.ms/AzureManagedPrometheus-optional-parameters.
| Nazwa |
Typ |
Opis |
|
metricAnnotationsAllowList
|
string
|
Rozdzielona przecinkami lista kluczy adnotacji Kubernetes, które będą używane w metryce etykiet zasobu (przykład: "namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],..."). Domyślnie metryka zawiera tylko nazwy zasobu i etykiety przestrzeni nazw.
|
|
metricLabelsAllowlist
|
string
|
Rozdzielona przecinkami lista dodatkowych kluczy etykiet Kubernetes, które będą używane w metryce etykiet zasobu (przykład: "namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...". Domyślnie metryka zawiera tylko nazwy zasobu i etykiety przestrzeni nazw.
|
ManagedClusterAzureMonitorProfileMetrics
Objekt
Profil metryki dla Azure Monitor managed service for Prometheus addon. Zbieraj gotowe metryki infrastruktury Kubernetes, które wysyłasz do Azure Monitor Workspace i konfiguruj dodatkowe scraping dla niestandardowych celów. Aby zapoznać się z omówieniem, zobacz aka.ms/AzureManagedPrometheus.
| Nazwa |
Typ |
Opis |
|
controlPlane
|
ManagedClusterAzureMonitorProfileMetricsControlPlane
|
Control plane metrics collection profile dla Azure Managed Prometheus addon. Konfiguruje zbieranie metryk operacyjnych z poziomu zarządzanego płaszczyzny sterowania (kube-apiserver, etcd itd.). Zobacz aka.ms/aks/controlplane-metrics po przegląd.
|
|
enabled
|
boolean
|
Czy włączyć lub wyłączyć Azure zarządzany dodatek Prometheus na potrzeby monitorowania Rozwiązania Prometheus. Aby uzyskać szczegółowe informacje na temat włączania i wyłączania, zobacz aka.ms/AzureManagedPrometheus-aks-enable.
|
|
kubeStateMetrics
|
ManagedClusterAzureMonitorProfileKubeStateMetrics
|
Kube State Metrics profile dla Azure Managed Prometheus addon. Te opcjonalne ustawienia dotyczą zasobnika kube-state-metrics wdrożonego za pomocą dodatku. Aby uzyskać szczegółowe informacje, zobacz aka.ms/AzureManagedPrometheus-optional-parameters.
|
ManagedClusterAzureMonitorProfileMetricsControlPlane
Objekt
Control plane metrics collection profile dla Azure Managed Prometheus addon. Konfiguruje zbieranie metryk operacyjnych z poziomu zarządzanego płaszczyzny sterowania (kube-apiserver, etcd itd.). Zobacz aka.ms/aks/controlplane-metrics po przegląd.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć czy wyłączyć zbieranie metryk płaszczyzn sterowania przez dodatek Azure Managed Prometheus. Domyślnie wyłączone. Zobacz aka.ms/aks/controlplane-metrics szczegóły.
|
ManagedClusterBootstrapProfile
Objekt
Profil bootstrap.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
artifactSource
|
ArtifactSource
|
Direct
|
Źródło artefaktu. Źródło, z którego są pobierane artefakty.
|
|
containerRegistryId
|
string
(arm-id)
|
|
Identyfikator zasobu Azure Container Registry. Rejestr musi mieć dostęp do sieci prywatnej, jednostkę SKU w warstwie Premium i nadmiarowość stref.
|
ManagedClusterCostAnalysis
Objekt
Konfiguracja analizy kosztów klastra
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Określa, czy włączyć analizę kosztów. Aby włączyć tę funkcję, musi być ustawiona wartość "Standardowa" lub "Premium". Włączenie tej opcji spowoduje dodanie szczegółów przestrzeni nazw i wdrożenia platformy Kubernetes do widoków Analiza kosztów w portalu Azure. Jeśli nie zostanie określony, wartość domyślna to false. Aby uzyskać więcej informacji, zobacz aka.ms/aks/docs/cost-analysis.
|
ManagedClusterHostedSystemProfile
Objekt
Ustawienia hostowanych dodatków systemowych.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Określa, czy włączyć hostowane dodatki systemowe dla klastra.
|
|
nodeSubnetID
|
string
(arm-id)
|
ID podsieci, do której dołączą węzły robocze zarządzane przez node auto provisioner do uruchamiania podów obciążeń w twoim tenantze. Musi to być dostarczone razem z systemNodeSubnetID i , apiserverAccessProfile.subnetIda wszystkie trzy identyfikatory podsieci muszą znajdować się w tym samym VNecie. Jeśli tego nie określisz, AKS utworzy podsieć w zarządzanej grupie zasobów z domyślnym CIDR /16.
|
|
systemNodeSubnetID
|
string
(arm-id)
|
ID podsieci, do której dołączą węzły systemowe zarządzane i hostowane przez AKS do uruchamiania krytycznych dodatków systemowych. Ten identyfikator musi być podany razem z nodeSubnetID i apiserverAccessProfile.subnetId, a wszystkie trzy identyfikatory podsieci muszą należeć do tego samego VNet-u. Jeśli tego nie określisz, AKS utworzy podsieć w zarządzanej grupie zasobów przy użyciu domyślnego CIDR /26.
|
ManagedClusterHTTPProxyConfig
Objekt
Konfiguracja serwera proxy HTTP klastra.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Określa, czy włączyć serwer proxy HTTP. Jeśli jest wyłączona, określona konfiguracja proxy nie będzie ustalana na podach i węzłach. Jeśli nie zostanie określony, wartość domyślna to true.
|
|
httpProxy
|
string
|
Punkt końcowy serwera proxy HTTP do użycia.
|
|
httpsProxy
|
string
|
Punkt końcowy serwera proxy HTTPS do użycia.
|
|
noProxy
|
string[]
|
Punkty końcowe, które nie powinny przechodzić przez serwer proxy.
|
|
trustedCa
|
string
|
Alternatywny certyfikat urzędu certyfikacji do użycia do nawiązywania połączenia z serwerami proxy.
|
ManagedClusterIdentity
Objekt
Tożsamość klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
delegatedResources
|
<string,
DelegatedResource>
|
Delegowane zasoby tożsamości przypisane do tego klastra zarządzanego. Może to ustawić tylko inny dostawca zasobów Azure, a zarządzany klaster akceptuje tylko jeden delegowany zasób tożsamości. Tylko do użytku wewnętrznego.
|
|
principalId
|
string
|
Identyfikator podmiotu zabezpieczeń tożsamości przypisanej przez system, który jest używany przez składniki główne.
|
|
tenantId
|
string
|
Identyfikator dzierżawy tożsamości przypisanej przez system, która jest używana przez składniki główne.
|
|
type
|
ResourceIdentityType
|
Typ tożsamości używany dla klastra zarządzanego. Więcej informacji można znaleźć w use managed identities in AKS.
|
|
userAssignedIdentities
|
<string,
ManagedServiceIdentityUserAssignedIdentitiesValue>
|
Tożsamość użytkownika skojarzona z klastrem zarządzanym. Ta tożsamość będzie używana w płaszczyźnie sterowania. Dozwolona jest tylko jedna tożsamość przypisana przez użytkownika. Klucze muszą być identyfikatorami zasobów usługi ARM w postaci: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".
|
ManagedClusterIngressProfile
Objekt
Profil ruchu przychodzącego dla klastra usługi kontenera.
ManagedClusterIngressProfileGatewayConfiguration
Objekt
Konfiguracja zarządzanych CRD API bram. Aby uzyskać więcej informacji, zobacz https://aka.ms/k8s-gateway-api.
ManagedClusterIngressProfileNginx
Objekt
Konfiguracja kontrolera ingress nginx dla profilu zarządzania klastrem wejściowym.
| Nazwa |
Typ |
Opis |
|
defaultIngressControllerType
|
NginxIngressControllerType
|
Typ ruchu przychodzącego domyślnego zasobu niestandardowego NginxIngressController
|
ManagedClusterIngressProfileWebAppRouting
Objekt
Ustawienia dodatku routingu aplikacji dla profilu ruchu przychodzącego.
ManagedClusterLoadBalancerProfile
Objekt
Profil modułu równoważenia obciążenia klastra zarządzanego.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
allocatedOutboundPorts
|
integer
(int32)
minimum: 0 maximum: 64000
|
0
|
Żądana liczba przydzielonych portów SNAT na maszynę wirtualną. Dozwolone wartości znajdują się w zakresie od 0 do 64000 (włącznie). Domyślna wartość to 0, co powoduje, że Azure dynamicznie przydziela porty.
|
|
backendPoolType
|
BackendPoolType
|
NodeIPConfiguration
|
Typ zarządzanego Load Balancer BackendPool zarządzanego ruchu przychodzącego.
|
|
effectiveOutboundIPs
|
ResourceReference[]
|
|
Efektywne zasoby adresów IP ruchu wychodzącego modułu równoważenia obciążenia klastra.
|
|
enableMultipleStandardLoadBalancers
|
boolean
|
|
Włącz wiele standardowych modułów równoważenia obciążenia na klaster usługi AKS lub nie.
|
|
idleTimeoutInMinutes
|
integer
(int32)
minimum: 4 maximum: 120
|
30
|
Żądany limit czasu bezczynności przepływu wychodzącego w minutach. Dozwolone wartości znajdują się w zakresie od 4 do 120 (włącznie). Wartość domyślna to 30 minut.
|
|
managedOutboundIPs
|
ManagedClusterLoadBalancerProfileManagedOutboundIPs
|
|
Pożądane zarządzane adresy IP wychodzące dla klastra load balancer.
|
|
outboundIPPrefixes
|
ManagedClusterLoadBalancerProfileOutboundIPPrefixes
|
|
Żądane zasoby prefiksu adresów IP dla modułu równoważenia obciążenia klastra.
|
|
outboundIPs
|
ManagedClusterLoadBalancerProfileOutboundIPs
|
|
Żądane zasoby adresów IP ruchu wychodzącego dla modułu równoważenia obciążenia klastra.
|
ManagedClusterLoadBalancerProfileManagedOutboundIPs
Objekt
Pożądane zarządzane adresy IP wychodzące dla klastra load balancer.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
count
|
integer
(int32)
minimum: 1 maximum: 100
|
1
|
Pożądana liczba IP IPv4 wychodzących utworzonych/zarządzanych przez Azure dla klastrowego load balancer. Dozwolone wartości muszą należeć do zakresu od 1 do 100 (włącznie). Wartość domyślna to 1.
|
|
countIPv6
|
integer
(int32)
minimum: 0 maximum: 100
|
0
|
Pożądana liczba IPv6 wychodzących IP utworzonych/zarządzanych przez Azure dla klastrowego load balancer. Dozwolone wartości muszą należeć do zakresu od 1 do 100 (włącznie). Wartość domyślna to 0 dla pojedynczego stosu i 1 dla podwójnego stosu.
|
ManagedClusterLoadBalancerProfileOutboundIPPrefixes
Objekt
Żądane zasoby prefiksu adresów IP dla modułu równoważenia obciążenia klastra.
| Nazwa |
Typ |
Opis |
|
publicIPPrefixes
|
ResourceReference[]
|
Lista zasobów prefiksu publicznego adresu IP.
|
ManagedClusterLoadBalancerProfileOutboundIPs
Objekt
Żądane zasoby adresów IP ruchu wychodzącego dla modułu równoważenia obciążenia klastra.
ManagedClusterManagedOutboundIPProfile
Objekt
Profil zarządzanych zasobów wychodzących IP klastra zarządzanego.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
count
|
integer
(int32)
minimum: 1 maximum: 16
|
1
|
Żądana liczba wychodzących adresów IP utworzonych/zarządzanych przez Azure. Dozwolone wartości muszą należeć do zakresu od 1 do 16 (włącznie). Wartość domyślna to 1.
|
|
countIPv6
|
integer
(int32)
minimum: 1 maximum: 16
|
|
Pożądana liczba IP wychodzących IPv6 utworzonych/zarządzanych przez Azure. Dozwolone wartości muszą należeć do zakresu od 1 do 16 (włącznie).
|
ManagedClusterMetricsProfile
Objekt
Profil metryk zarządzanychcluster.
ManagedClusterNATGatewayProfile
Objekt
Profil bramy translatora adresów sieciowych klastra zarządzanego.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
effectiveOutboundIPs
|
ResourceReference[]
|
|
Efektywne zasoby adresów IP ruchu wychodzącego bramy translatora adresów sieciowych klastra.
|
|
idleTimeoutInMinutes
|
integer
(int32)
minimum: 4 maximum: 120
|
4
|
Żądany limit czasu bezczynności przepływu wychodzącego w minutach. Dozwolone wartości znajdują się w zakresie od 4 do 120 (włącznie). Wartość domyślna to 4 minuty.
|
|
managedOutboundIPProfile
|
ManagedClusterManagedOutboundIPProfile
|
|
Profil zarządzanych zasobów wychodzących IP bramy translatora adresów sieciowych klastra.
|
|
outboundIPPrefixes
|
OutboundIPPrefixes
|
|
Pożądane zasoby prefiksu IP wychodzącego dla zarządzanej bramy NAT. Kompatybilny tylko z NAT Gateway V2.
|
|
outboundIPs
|
OutboundIPs
|
|
Pożądane wychodzące zasoby IP dla zarządzanej bramy NAT.
|
|
sku
|
ManagedClusterNATGatewaySku
|
|
SKU zarządzanego klastra NAT Gateway. Domyślnie wybiera 'StandardV2' tam, gdzie jest dostępny w regionie, w przeciwnym razie 'Standard'.
|
ManagedClusterNATGatewaySku
Wyliczenie
SKU zarządzanego klastra NAT Gateway.
| Wartość |
Opis |
|
Standard
|
Użyj standardowej bramki NAT SKU.
|
|
StandardV2
|
Użyj bramki NAT StandardV2 SKU. Jest to domyślne rozwiązanie dla nowych klastrów w regionach, gdzie jest dostępne.
|
ManagedClusterNodeProvisioningProfile
Objekt
Profil provisioningu węzłów dla zarządzanego klastra.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
defaultNodePools
|
NodeProvisioningDefaultNodePools
|
Auto
|
Zestaw domyślnych pul węzłów Karpenter (CRD) skonfigurowanych do aprowizacji węzłów. To pole nie działa, chyba że tryb ma wartość "Auto". Ostrzeżenie: Zmiana tej opcji z Automatycznie na Brak w istniejącym klastrze spowoduje usunięcie domyślnych pul węzłów Karpenter, co spowoduje opróżnienie i usunięcie węzłów skojarzonych z tymi pulami. Zdecydowanie zaleca się, aby tego nie robić, chyba że istnieją bezczynne węzły gotowe do podjęcia zasobników eksmitowanych przez tę akcję. Jeśli nie zostanie określony, wartość domyślna to Auto. Aby uzyskać więcej informacji, zobacz aka.ms/aks/nap#node-pools.
|
|
mode
|
NodeProvisioningMode
|
|
Tryb aprowizacji węzła. Jeśli nie zostanie określony, wartość domyślna to Ręczne.
|
ManagedClusterNodeResourceGroupProfile
Objekt
Profil blokady grupy zasobów węzła dla klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
restrictionLevel
|
RestrictionLevel
|
Poziom ograniczeń zastosowany do grupy zasobów węzła klastra. Jeśli nie zostanie określony, wartość domyślna to "Bez ograniczeń"
|
ManagedClusterOIDCIssuerProfile
Objekt
Profil wystawcy OIDC klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy wystawca OIDC jest włączony.
|
|
issuerURL
|
string
|
Adres URL wystawcy OIDC klastra zarządzanego.
|
ManagedClusterPodIdentity
Objekt
Szczegółowe informacje o tożsamości zasobnika przypisanej do klastra zarządzanego.
ManagedClusterPodIdentityException
Objekt
Wyjątek tożsamości podu, który pozwala kapsłom z określonymi etykietami uzyskać dostęp do punktu końcowego Azure Instance Metadata Service (IMDS) bez przechwycenia przez serwer tożsamości zarządzany przez węzeł (NMI). Aby uzyskać więcej informacji, zobacz disable AAD Pod Identity for a specific Pod/Application (Wyłączanie tożsamości zasobnika usługi AAD).
| Nazwa |
Typ |
Opis |
|
name
|
string
|
Nazwa wyjątku tożsamości zasobnika.
|
|
namespace
|
string
|
Przestrzeń nazw wyjątku tożsamości zasobnika.
|
|
podLabels
|
object
|
Etykiety zasobników do dopasowania.
|
ManagedClusterPodIdentityProfile
Objekt
Profil tożsamości zasobnika klastra zarządzanego. Zobacz używanie tożsamości zasobnika usługi AAD, aby uzyskać więcej informacji na temat integracji tożsamości zasobnika.
| Nazwa |
Typ |
Opis |
|
allowNetworkPluginKubenet
|
boolean
|
Określa, czy tożsamość zasobnika może być uruchamiana w klastrach z siecią Kubenet. Uruchamianie w usłudze Kubenet jest domyślnie wyłączone ze względu na charakter związany z zabezpieczeniami tożsamości zasobnika usługi AAD i ryzyko fałszowania adresów IP. Zobacz wtyczkę sieciową Kubenet using with AAD Pod Identity aby uzyskać więcej informacji.
|
|
enabled
|
boolean
|
Czy dodatek tożsamości zasobnika jest włączony.
|
|
userAssignedIdentities
|
ManagedClusterPodIdentity[]
|
Tożsamości zasobników do użycia w klastrze.
|
|
userAssignedIdentityExceptions
|
ManagedClusterPodIdentityException[]
|
Wyjątki dotyczące tożsamości zasobnika, które mają być dozwolone.
|
ManagedClusterPodIdentityProvisioningError
Objekt
Odpowiedź na błąd z aprowizacji tożsamości zasobnika.
ManagedClusterPodIdentityProvisioningErrorBody
Objekt
Odpowiedź na błąd z aprowizacji tożsamości zasobnika.
| Nazwa |
Typ |
Opis |
|
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
|
details
|
ManagedClusterPodIdentityProvisioningErrorBody[]
|
Lista dodatkowych szczegółów dotyczących błędu.
|
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|
|
target
|
string
|
Element docelowy określonego błędu. Na przykład nazwa właściwości w błędzie.
|
ManagedClusterPodIdentityProvisioningInfo
Objekt
Informacje o przydzielaniu tożsamości kapsuły.
ManagedClusterPodIdentityProvisioningState
Wyliczenie
Bieżący stan aprowizacji tożsamości zasobnika.
| Wartość |
Opis |
|
Assigned
|
Przypisana jest tożsamość kapsuły.
|
|
Canceled
|
Przypisanie tożsamości kapsuły zostało anulowane.
|
|
Deleting
|
Tożsamość kapsuły jest usuwana.
|
|
Failed
|
Przypisanie tożsamości kapsuły nie powiodło się.
|
|
Succeeded
|
Przypisanie tożsamości kapsuły zakończyło się sukcesem.
|
|
Updating
|
Tożsamość kapsuły jest aktualizowana.
|
ManagedClusterPropertiesAutoScalerProfile
Objekt
Parametry, które mają być stosowane do skalowania automatycznego klastra po włączeniu
| Nazwa |
Typ |
Opis |
|
balance-similar-node-groups
|
string
|
Wykrywa podobne pule węzłów i równoważy liczbę węzłów między nimi. Prawidłowe wartości to "true" i "false"
|
|
daemonset-eviction-for-empty-nodes
|
boolean
|
Zasobniki DaemonSet zostaną bezpiecznie zakończone z pustych węzłów. Jeśli ustawiono wartość true, wszystkie zasobniki demonaset w pustych węzłach zostaną wykluczone przed usunięciem węzła. Jeśli zasobnik demona nie może zostać wykluczony z innego węzła, zostanie wybrany do skalowania. Jeśli zostanie ustawiona wartość false, węzeł zostanie usunięty bez upewnienia się, że zasobniki demona są usuwane lub eksmitowane.
|
|
daemonset-eviction-for-occupied-nodes
|
boolean
|
Zasobniki DaemonSet zostaną bezpiecznie zakończone z węzłów, które nie są puste. Jeśli ustawiono wartość true, wszystkie zasobniki demonaset na zajętych węzłach zostaną wykluczone przed usunięciem węzła. Jeśli zasobnik demona nie może zostać wykluczony z innego węzła, zostanie wybrany do skalowania. Jeśli zostanie ustawiona wartość false, węzeł zostanie usunięty bez upewnienia się, że zasobniki demona są usuwane lub eksmitowane.
|
|
expander
|
Expander
|
Ekspander do użycia podczas skalowania w górę. Jeśli nie zostanie określony, wartość domyślna to "losowe". Zobacz expanders aby uzyskać więcej informacji.
|
|
ignore-daemonsets-utilization
|
boolean
|
Czy urząd certyfikacji powinien ignorować zasobniki DaemonSet podczas obliczania wykorzystania zasobów na potrzeby skalowania w dół. W przypadku ustawienia wartości true zasoby używane przez demona zostaną uwzględnione podczas podejmowania decyzji dotyczących skalowania w dół.
|
|
max-empty-bulk-delete
|
string
|
Maksymalna liczba pustych węzłów, które można usunąć w tym samym czasie. Musi to być dodatnia liczba całkowita. Wartość domyślna to 10.
|
|
max-graceful-termination-sec
|
string
|
Maksymalna liczba sekund, przez które narzędzie do automatycznego skalowania klastra oczekuje na zakończenie działania zasobnika podczas próby skalowania węzła w dół. Wartość domyślna to 600.
|
|
max-node-provision-time
|
string
|
Maksymalny czas oczekiwania autoskalatora na aprowizowanie węzła. Wartość domyślna to "15m". Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
max-total-unready-percentage
|
string
|
Maksymalny procent nieprzeczytanych węzłów w klastrze. Po przekroczeniu tej wartości procentowej funkcja automatycznego skalowania klastra zatrzymuje operacje. Wartość domyślna to 45. Wartość maksymalna to 100, a wartość minimalna to 0.
|
|
new-pod-scale-up-delay
|
string
|
Ignoruj niezaplanowane zasobniki, zanim będą w pewnym wieku. W przypadku scenariuszy, takich jak skalowanie wsadowe/ wsadowe, w których nie chcesz, aby urząd certyfikacji działał przed zaplanowaniem harmonogramu kubernetes, można poinformować urząd certyfikacji, aby ignorował nieplanowane zasobniki przed upływem określonego wieku. Wartość domyślna to "0s". Wartości muszą być liczbą całkowitą, po której następuje jednostka (w sekundach, "m" przez minuty, "h" przez godziny itp.).
|
|
ok-total-unready-count
|
string
|
Liczba dozwolonych nieprzeczytanych węzłów niezależnie od maksymalnej liczby nieprzeczytanych wartości procentowych. Musi to być liczba całkowita. Wartość domyślna to 3.
|
|
scale-down-delay-after-add
|
string
|
Po jakim czasie od skalowania w górę wznawiana jest ocena skalowania w dół. Wartość domyślna to "10m". Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
scale-down-delay-after-delete
|
string
|
Jak długo po usunięciu węzła ponownie rozpoczyna się ocena skalowania w dół. Wartość domyślna to interwał skanowania. Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
scale-down-delay-after-failure
|
string
|
Po jakim czasie od niepowodzenia skalowania w dół ponownie rozpoczyna się ocena skalowania w dół. Wartość domyślna to "3m". Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
scale-down-unneeded-time
|
string
|
Jak długo węzeł powinien być niepotrzebny, zanim kwalifikuje się do skalowania w dół. Wartość domyślna to "10m". Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
scale-down-unready-time
|
string
|
Jak długo niegotowy węzeł powinien być niepotrzebny, zanim będzie kwalifikował się do skalowania w dół. Wartość domyślna to "20m". Wartości muszą być liczbą całkowitą, po której następuje 'm'. Nie jest obsługiwana żadna jednostka czasu innego niż minuty (m).
|
|
scale-down-utilization-threshold
|
string
|
Poziom wykorzystania węzła zdefiniowany jako suma żądanych zasobów podzielonych przez pojemność, poniżej którego węzeł można rozważyć pod kątem skalowania w dół. Wartość domyślna to "0,5".
|
|
scan-interval
|
string
|
Częstotliwość ponownego oceny klastra w celu skalowania w górę lub w dół. Wartość domyślna to "10". Wartości muszą być liczbą całkowitą sekund.
|
|
skip-nodes-with-local-storage
|
string
|
Jeśli klaster, autoskaler pominie usuwanie węzłów z podami z lokalnym storage, na przykład EmptyDir lub HostPath. Wartość domyślna to true.
|
|
skip-nodes-with-system-pods
|
string
|
Jeśli automatyczne skalowanie klastra pominie usuwanie węzłów z zasobnikami z kube-system (z wyjątkiem DaemonSet lub dublowanych zasobników). Wartość domyślna to true.
|
ManagedClusterSecurityProfile
Objekt
Profil zabezpieczeń klastra usługi kontenera.
ManagedClusterSecurityProfileDefender
Objekt
Ustawienia Microsoft Defender dla profilu bezpieczeństwa.
| Nazwa |
Typ |
Opis |
|
logAnalyticsWorkspaceResourceId
|
string
(arm-id)
|
Identyfikator zasobu w obszarze roboczym Log Analytics do powiązania z Microsoft Defender. Po włączeniu Microsoft Defender to pole jest wymagane i musi być prawidłowym identyfikatorem zasobu obszaru roboczego. Po wyłączeniu Microsoft Defender pozostaw pole puste.
|
|
securityGating
|
ManagedClusterSecurityProfileDefenderSecurityGating
|
Ustawienia Microsoft Defender dla zabezpieczeń (security gating). To potwierdza kwalifikacje obrazów kontenerów do wdrożenia na podstawie wyników bezpieczeństwa Defender for Containers. Za pomocą Admission Controller audytuje lub uniemożliwia wdrażanie obrazów niespełniających standardów bezpieczeństwa. Aby uzyskać więcej informacji, zobacz https://aka.ms/KubernetesDefenderAuditRule.
|
|
securityMonitoring
|
ManagedClusterSecurityProfileDefenderSecurityMonitoring
|
Wykrywanie zagrożeń w Microsoft Defender dla ustawień chmury dla profilu bezpieczeństwa.
|
ManagedClusterSecurityProfileDefenderSecurityGating
Objekt
Ustawienia Microsoft Defender dla zabezpieczeń (security gating). To potwierdza kwalifikację obrazów kontenerów do wdrożenia na podstawie wyników bezpieczeństwa Defender for Containers. Za pomocą Admission Controller audytuje lub uniemożliwia wdrażanie obrazów niespełniających standardów bezpieczeństwa.
| Nazwa |
Typ |
Opis |
|
allowSecretAccess
|
boolean
|
Używany tylko podczas użycia rejestru jest przyznawany przez sekret, a nie przez tożsamość zarządzaną. Ustala, czy przyznać agentowi Defender gating dostęp do sekretów klastra do pobierania obrazów z rejestrów. Jeśli dostęp do sekretów zostanie odrzucony, a rejestr wymaga pull secretów, dodatek nie wykona walidacji obrazu. Wartość domyślna to false.
|
|
enabled
|
boolean
|
Czy włączyć funkcję gating zabezpieczeń usługi Defender. Po włączeniu funkcja gateringu skanuje obrazy kontenerów i audytuje lub blokuje wdrażanie obrazów, które nie spełniają standardów bezpieczeństwa zgodnie z skonfigurowanymi regułami bezpieczeństwa. Aby uzyskać więcej informacji, zobacz https://aka.ms/KubernetesDefenderAuditRule.
|
|
identities
|
ManagedClusterSecurityProfileDefenderSecurityGatingIdentity[]
|
Lista tożsamości, których kontroler przyjęć używa do pobierania artefaktów bezpieczeństwa z rejestrów. Są to te same tożsamości używane przez klaster do ściągania obrazów kontenerów. Więcej informacji na temat konfiguracji tej tożsamości można znaleźć w .https://learn.microsoft.com/en-us/azure/defender-for-cloud/gated-deployment-infrastructure-as-code
|
ManagedClusterSecurityProfileDefenderSecurityGatingIdentity
Objekt
Mapowanie tożsamości używane przez Defender do zabezpieczeń do dostępu do rejestru.
| Nazwa |
Typ |
Opis |
|
azureContainerRegistry
|
string
|
Rejestr kontenerów, dla którego będzie używana tożsamość; tożsamość określona w tym miejscu powinna mieć dołączone poświadczenie tożsamości federacyjnej.
|
|
identity
|
UserAssignedIdentity
|
Obiekt tożsamości używany do accessu rejestru
|
ManagedClusterSecurityProfileDefenderSecurityMonitoring
Objekt
Ustawienia Microsoft Defender dotyczące wykrywania zagrożeń w profilu bezpieczeństwa.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć wykrywanie zagrożeń w usłudze Defender
|
ManagedClusterSecurityProfileImageCleaner
Objekt
Narzędzie Image Cleaner usuwa nieużywane obrazy z węzłów, zwalniając miejsce na dysku i pomagając zmniejszyć obszar powierzchni podatnej na ataki. Poniżej przedstawiono ustawienia profilu zabezpieczeń.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć narzędzie Image Cleaner w klastrze usługi AKS.
|
|
intervalHours
|
integer
(int32)
|
Interwał skanowania czyszczenia obrazów w godzinach.
|
ManagedClusterSecurityProfileWorkloadIdentity
Objekt
Ustawienia tożsamości obciążenia dla profilu zabezpieczeń.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć tożsamość obciążenia.
|
ManagedClusterServicePrincipalProfile
Objekt
Informacje o tożsamości głównej usługi dla klastra do manipulacji API Azure.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
|
Identyfikator jednostki usługi.
|
|
secret
|
string
(password)
|
Hasło tajne skojarzone z jednostką usługi w postaci zwykłego tekstu.
|
ManagedClusterSKU
Objekt
Jednostka SKU klastra zarządzanego.
ManagedClusterSKUName
Wyliczenie
Nazwa jednostki SKU klastra zarządzanego.
| Wartość |
Opis |
|
Base
|
Opcja podstawowa dla płaszczyzny sterowania usługi AKS.
|
|
Automatic
|
Klastry automatyczne są zoptymalizowane pod kątem uruchamiania większości obciążeń produkcyjnych z konfiguracją zgodną z najlepszymi rozwiązaniami i zaleceniami dotyczącymi konfiguracji, skalowalności i zabezpieczeń klastra i obciążenia usługi AKS. Aby uzyskać więcej informacji na temat klastrów automatycznych, zobacz aka.ms/aks/automatic.
|
ManagedClusterSKUTier
Wyliczenie
Warstwa jednostki SKU klastra zarządzanego. Jeśli nie zostanie określony, wartość domyślna to "Bezpłatna". Zobacz AKS Pricing Tier aby uzyskać więcej szczegółów.
| Wartość |
Opis |
|
Premium
|
Klaster ma funkcje w warstwie Premium oprócz wszystkich funkcji dostępnych w wersji "Standardowa". Wersja Premium umożliwia wybór opcji LongTermSupport (aka.ms/aks/lts) dla niektórych wersji platformy Kubernetes.
|
|
Standard
|
Zalecane w przypadku obciążeń o znaczeniu krytycznym i produkcyjnym. Obejmuje automatyczne skalowanie płaszczyzny sterowania Platformy Kubernetes, testowanie intensywnie korzystające z obciążenia i maksymalnie 5000 węzłów na klaster. Gwarantuje 99,95% dostępności endpointa serwera API Kubernetes dla klastrów korzystających z Strefy dostępności oraz 99,9% dostępności dla klastrów, które nie korzystają z Strefy dostępności.
|
|
Free
|
Zarządzanie klastrem jest bezpłatne, ale naliczane są opłaty za użycie maszyn wirtualnych, magazynu i sieci. Najlepsze w przypadku eksperymentów, uczenia się, prostego testowania lub obciążeń z mniej niż 10 węzłami. Niezalecane w przypadku przypadków użycia w środowisku produkcyjnym.
|
ManagedClusterStaticEgressGatewayProfile
Objekt
Konfiguracja dodatku static Egress Gateway dla klastra.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Włącz dodatek Static Egress Gateway. Wskazuje, czy dodatek bramy ruchu wychodzącego statycznego jest włączony, czy nie.
|
ManagedClusterStatus
Objekt
Zawiera informacje tylko do odczytu dotyczące klastra zarządzanego.
| Nazwa |
Typ |
Opis |
|
provisioningError
|
ErrorDetail
|
Szczegółowe informacje o błędzie klastra zarządzanego. Zachowuje szczegółowe informacje o błędzie. Jeśli nie wystąpił błąd, to pole zostanie pominięte.
|
ManagedClusterStorageProfile
Objekt
Profil magazynu dla klastra usługi kontenera.
ManagedClusterStorageProfileBlobCSIDriver
Objekt
Ustawienia sterownika CSI AzureBlob dla profilu storage.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć sterownik AZUREBlob CSI. Wartość domyślna to fałsz.
|
ManagedClusterStorageProfileDiskCSIDriver
Objekt
Ustawienia sterownika CSI AzureDisk dla profilu storage.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć sterownik AzureDisk CSI. Wartość domyślna to true.
|
ManagedClusterStorageProfileFileCSIDriver
Objekt
Ustawienia sterownika CSI AzureFile dla profilu storage.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć sterownik AzureFile CSI. Wartość domyślna to true.
|
ManagedClusterStorageProfileSnapshotController
Objekt
Ustawienia Snapshot Controller dla profilu storage.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć kontroler migawek. Wartość domyślna to true.
|
ManagedClusterWebAppRoutingGatewayAPIImplementations
Objekt
Konfiguracje dla dostawców API bram do zarządzania wejściem z pomocą trasowania aplikacji.
| Nazwa |
Typ |
Opis |
|
appRoutingIstio
|
ManagedClusterAppRoutingIstio
|
Konfiguracja do użycia płaszczyzny sterującej Istio bez sidecarów do zarządzanego wejścia za pośrednictwem API Gateway z routowaniem aplikacji. Zobacz https://aka.ms/gateway-on-istio informacje o wykorzystaniu Istio do wejścia przez API bramy.
|
ManagedClusterWindowsProfile
Objekt
Profil dla maszyn wirtualnych Windows w zarządzanym klastrze.
| Nazwa |
Typ |
Opis |
|
adminPassword
|
string
(password)
|
Określa hasło konta administratora.
minimalna długość : 8 znaków
maksymalna długość: 123 znaków
wymagania dotyczące złożoności: należy spełnić 3 na 4 poniższe warunki Ma małe znaki Ma wielkie znaki Ma cyfrę Ma znak specjalny (dopasowanie wyrażenia regularnego [\W_])
niedozwolone wartości: "abc@123", "P@$$w 0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"
|
|
adminUsername
|
string
|
Określa nazwę konta administratora.
Ograniczenie: Nie można zakończyć się "."
niedozwolone wartości: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
Minimalna długość: 1 znak
maksymalna długość: 20 znaków
|
|
enableCSIProxy
|
boolean
|
Czy włączyć serwer proxy CSI. Więcej szczegółów na temat proxy'ego CSI można znaleźć w CSI proxy GitHub repozytorium.
|
|
gmsaProfile
|
WindowsGmsaProfile
|
Profil gMSA systemu Windows w klastrze zarządzanym.
|
|
licenseType
|
LicenseType
|
Typ licencji do użycia dla maszyn wirtualnych z systemem Windows. Zobacz Azure Korzyści dla Hybrydowych Użytkowników aby uzyskać więcej szczegółów.
|
ManagedClusterWorkloadAutoScalerProfile
Objekt
Profil automatycznego skalowania obciążenia dla klastra zarządzanego.
ManagedClusterWorkloadAutoScalerProfileKeda
Objekt
Ustawienia skalowania automatycznego opartego na zdarzeniach platformy KEDA (Kubernetes Event-driven Autoscaling) dla profilu automatycznego skalowania obciążenia.
| Nazwa |
Typ |
Opis |
|
enabled
|
boolean
|
Czy włączyć usługę KEDA.
|
ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler
Objekt
Ustawienia narzędzia VPA (vertical Pod Autoscaler) dla profilu automatycznego skalowania obciążenia.
| Nazwa |
Typ |
Domyślna wartość |
Opis |
|
enabled
|
boolean
|
False
|
Czy włączyć vpa. Wartość domyślna to false.
|
ManagedGatewayType
Wyliczenie
Konfiguracja instalacji interfejsu API bramy zarządzanej. Jeśli nie zostanie określony, wartość domyślna to "Wyłączone". Aby uzyskać więcej informacji, zobacz https://aka.ms/k8s-gateway-api.
| Wartość |
Opis |
|
Disabled
|
Identyfikatory CRD interfejsu API bramy nie zostaną uzgodnione w klastrze.
|
|
Standard
|
CRD API bram z kanału standardowego będą uzgadniane na Twoim klastrze. Sprawdź https://aka.ms/gateway-api-versions , który pakiet zostanie zainstalowany dla Twojej wersji Kubernetes.
|
ManagedServiceIdentityUserAssignedIdentitiesValue
Objekt
Właściwości tożsamości przypisanej przez użytkownika.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
|
Identyfikator klienta tożsamości przypisanej przez użytkownika.
|
|
principalId
|
string
|
Identyfikator podmiotu zabezpieczeń tożsamości przypisanej przez użytkownika.
|
ManualScaleProfile
Objekt
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".
|
NetworkDataplane
Wyliczenie
Plan danych sieci używany w klastrze Kubernetes.
| Wartość |
Opis |
|
azure
|
Użyj płaszczyzny danych sieci platformy Azure.
|
|
cilium
|
Użyj płaszczyzny danych sieci Cilium. Zobacz Azure CNI zasilany przez Cilium aby uzyskać więcej informacji.
|
NetworkMode
Wyliczenie
Tryb sieciowy, z którym skonfigurowany jest Azure CNI. Nie można tego określić, jeśli networkPlugin jest czymś innym niż 'azure'.
| Wartość |
Opis |
|
transparent
|
Nie utworzono mostka. Intra-VM komunikacja Pod-Pod odbywa się za pośrednictwem tras IP utworzonych przez Azure CNI. Aby uzyskać więcej informacji, zobacz tryb przezroczysty.
|
|
bridge
|
Nie jest to już obsługiwane
|
NetworkPlugin
Wyliczenie
Wtyczka sieci używana do tworzenia sieci Kubernetes.
| Wartość |
Opis |
|
azure
|
Użyj wtyczki sieciowej usługi Azure CNI. Zobacz Azure CNI (zaawansowane) sieci aby uzyskać więcej informacji.
|
|
kubenet
|
Użyj wtyczki sieciowej Kubenet. Aby uzyskać więcej informacji, zobacz sieci platformy Kubenet (podstawowa).
|
|
none
|
Wtyczka CNI nie jest wstępnie zainstalowana. Aby uzyskać więcej informacji, zobacz BYO CNI.
|
NetworkPluginMode
Wyliczenie
Tryb, który ma być używany przez wtyczkę sieci.
| Wartość |
Opis |
|
overlay
|
Używany z parametrem networkPlugin=azure, zasobniki otrzymują adresy IP z przestrzeni adresowej PodCIDR, ale używają domen routingu platformy Azure, a nie metody tabel tras platformy Kubenet. Aby uzyskać więcej informacji, odwiedź https://aka.ms/aks/azure-cni-overlay.
|
NetworkPolicy
Wyliczenie
Zasady sieci używane do tworzenia sieci Kubernetes.
| Wartość |
Opis |
|
none
|
Zasady sieci nie zostaną wymuszone. Jest to wartość domyślna, gdy wartość NetworkPolicy nie jest określona.
|
|
calico
|
Użyj zasad sieci Calico. Zobacz differences between Azure a Calico policies aby uzyskać więcej informacji.
|
|
azure
|
Użyj zasad sieci platformy Azure. Zobacz differences between Azure a Calico policies aby uzyskać więcej informacji.
|
|
cilium
|
Użyj narzędzia Cilium, aby wymusić zasady sieciowe. Wymaga to, aby networkDataplane był "cilium".
|
NginxIngressControllerType
Wyliczenie
Typ ruchu przychodzącego domyślnego zasobu niestandardowego NginxIngressController
| Wartość |
Opis |
|
AnnotationControlled
|
Zostanie utworzony domyślny kontroler NginxIngressController. Użytkownicy mogą edytować domyślny zasób niestandardowy NginxIngressController, aby skonfigurować adnotacje modułu równoważenia obciążenia.
|
|
External
|
Zostanie utworzony domyślny kontroler NginxIngressController, a operator będzie aprowizować zewnętrzny moduł równoważenia obciążenia. Każda adnotacja, aby domyślny moduł równoważenia obciążenia był wewnętrzny, zostanie zastąpiony.
|
|
Internal
|
Zostanie utworzony domyślny kontroler NginxIngressController, a operator zaaprowizuje wewnętrzny moduł równoważenia obciążenia. Wszelkie adnotacje, które mają na celu ustawienie domyślnego modułu równoważenia obciążenia zewnętrznego, zostaną zastąpione.
|
|
None
|
Domyślny kontroler ruchu przychodzącego nie zostanie utworzony. Nie zostanie on usunięty przez system, jeśli istnieje. Użytkownicy powinni ręcznie usunąć domyślny zasób niestandardowy NginxIngressController.
|
NodeOSUpgradeChannel
Wyliczenie
Kanał uaktualniania systemu operacyjnego węzła. Sposób aktualizowania systemu operacyjnego w węzłach. Wartość domyślna to NodeImage.
| Wartość |
Opis |
|
None
|
Żadna próba zaktualizowania systemu operacyjnego maszyn nie zostanie podjęta przez system operacyjny lub przez stopniowe dyski VHD. Oznacza to, że odpowiadasz za aktualizacje zabezpieczeń
|
|
Unmanaged
|
Aktualizacje systemu operacyjnego będą stosowane automatycznie za pośrednictwem wbudowanej infrastruktury stosowania poprawek systemu operacyjnego. Nowo skalowane w maszynach będą początkowo niezaznaczone i będą poprawiane w pewnym momencie przez infrastrukturę systemu operacyjnego. Zachowanie tej opcji zależy od danego systemu operacyjnego. System Ubuntu i Mariner stosują poprawki zabezpieczeń za pośrednictwem nienadzorowanego uaktualnienia mniej więcej raz dziennie około 06:00 UTC. System Windows nie stosuje automatycznie poprawek zabezpieczeń, dlatego dla nich ta opcja jest równoważna brakowi do odwołania
|
|
NodeImage
|
Usługa AKS zaktualizuje węzły przy użyciu nowo poprawionego wirtualnego dysku twardego zawierającego poprawki zabezpieczeń i poprawki błędów co tydzień. Po ponownym odtworzeniu obrazu wirtualnego dysku twardego maszyny aktualizacji zostaną wyświetlone na tym dysku VHD po oknach konserwacji i ustawieniach skoków. Podczas wybierania tej opcji jako hostowanie obrazów przez usługę AKS nie są naliczane żadne dodatkowe koszty dysku VHD.
|
|
SecurityPatch
|
Usługa AKS pobiera i aktualizuje węzły przy użyciu przetestowanych aktualizacji zabezpieczeń. Te aktualizacje honorują ustawienia okna obsługi i tworzą nowy wirtualny dysk twardy używany w nowych węzłach. W niektórych przypadkach nie można zastosować aktualizacji, w takich przypadkach istniejące węzły również zostaną ponownie zreprodukowane do nowo utworzonego wirtualnego dysku twardego w celu zastosowania zmian. Ta opcja wiąże się z dodatkowymi kosztami hostowania nowych dysków VHD poprawek zabezpieczeń w grupie zasobów na potrzeby użycia just in time.
|
NodeProvisioningDefaultNodePools
Wyliczenie
Zestaw domyślnych pul węzłów Karpenter (CRD) skonfigurowanych do aprowizacji węzłów. To pole nie działa, chyba że tryb ma wartość "Auto". Ostrzeżenie: Zmiana tej opcji z Automatycznie na Brak w istniejącym klastrze spowoduje usunięcie domyślnych pul węzłów Karpenter, co spowoduje opróżnienie i usunięcie węzłów skojarzonych z tymi pulami. Zdecydowanie zaleca się, aby tego nie robić, chyba że istnieją bezczynne węzły gotowe do podjęcia zasobników eksmitowanych przez tę akcję. Jeśli nie zostanie określony, wartość domyślna to Auto. Aby uzyskać więcej informacji, zobacz aka.ms/aks/nap#node-pools.
| Wartość |
Opis |
|
None
|
Żadne pule węzłów Karpenter nie są aprowizowane automatycznie. Automatyczne skalowanie nie będzie miało miejsca, chyba że użytkownik utworzy co najmniej jedną instancję CRD NodePool.
|
|
Auto
|
Aprowizowany jest standardowy zestaw Karpenter NodePools
|
NodeProvisioningMode
Wyliczenie
Tryb aprowizacji węzła. Jeśli nie zostanie określony, wartość domyślna to Ręczne.
| Wartość |
Opis |
|
Manual
|
Węzły są aprowidowane ręcznie przez użytkownika
|
|
Auto
|
Węzły są aprowizowane automatycznie przez usługę AKS przy użyciu narzędzia Karpenter (zobacz aka.ms/aks/nap, aby uzyskać więcej informacji). Nadal można tworzyć pule węzłów o stałym rozmiarze, ale nie można skalować automatycznie pul węzłów. (Zobacz aka.ms/aks/nap, aby uzyskać więcej informacji).
|
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. Więcej informacji można znaleźć w Ephemeral OS.
| Wartość |
Opis |
|
Managed
|
Platforma Azure replikuje dysk systemu operacyjnego dla maszyny wirtualnej do usługi Azure Storage, aby uniknąć utraty danych, jeśli maszyna wirtualna musi zostać przeniesiona 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 Kubernetes <>= 1.25, jeśli typ systemu operacyjnego to Windows.
| Wartość |
Opis |
|
Ubuntu
|
Użyj systemu Ubuntu jako systemu operacyjnego dla obrazów węzłów.
|
|
AzureLinux
|
Użyj usługi AzureLinux jako systemu operacyjnego dla obrazów węzłów. Azure Linux to dystrybutor Linuksa zoptymalizowany pod kątem kontenerów, stworzony przez Microsoft, odwiedź https://aka.ms/azurelinux po więcej informacji.
|
|
AzureLinux3
|
Użyj AzureLinux3 jako systemu operacyjnego dla obrazów węzłów. Azure Linux to dystrybutor Linuksa zoptymalizowany pod kątem kontenerów, stworzony przez Microsoft, odwiedź https://aka.ms/azurelinux po 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. Microsoft zaleca, aby nowe wdrożenia wybierały zamiast tego 'AzureLinux'.
|
|
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.
|
|
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
|
|
Windows2025
|
Użyj systemu Windows2025 jako systemu operacyjnego dla obrazów węzłów. Nieobsługiwane dla pul węzłów systemowych. Windows2025 obsługuje kontenery Windows2022 i Windows 2025; nie może uruchamiać kontenerów Windows2019 i odwrotnie.
|
|
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 platformy Kubernetes, zobacz https://aka.ms/aks/supported-ubuntu-versions
|
|
AzureContainerLinux
|
Użyj Azure Container Linux jako systemu operacyjnego dla obrazów node. Azure Container Linux to system Linux zoptymalizowany pod względem kontenerów, skoncentrowany na bezpieczeństwie, oparty na Azure Linux, z niezmiennym systemem plików. ACL wywodzi się z projektu Flatcar Container Linux, bazując na sprawdzonym modelu kontenerowym, niezmiennym Flatcar, jednocześnie dodając pakiety Azure Linux, obsługę oraz głęboką integrację z cyklem życia Azure i AKS. Aby uzyskać więcej informacji, zobacz https://aka.ms/azurecontainerlinux
|
OSType
Wyliczenie
Typ systemu operacyjnego. Wartość domyślna to Linux.
| Wartość |
Opis |
|
Linux
|
Użyj systemu Linux.
|
|
Windows
|
Użyj systemu Windows.
|
OutboundIPPrefixes
Objekt
Pożądane zasoby prefiksu IP wychodzącego dla zarządzanej bramy NAT. Kompatybilny tylko z NAT Gateway V2.
| Nazwa |
Typ |
Opis |
|
publicIPPrefixes
|
string[]
(arm-id)
|
Lista zasobów prefiksu publicznego adresu IP.
|
OutboundIPs
Objekt
Pożądane wychodzące zasoby IP dla zarządzanej bramy NAT.
| Nazwa |
Typ |
Opis |
|
publicIPs
|
string[]
(arm-id)
|
Lista zasobów publicznych adresów IP.
|
OutboundType
Wyliczenie
Metoda routingu ruchu wychodzącego (wychodzącego). Można to ustawić tylko w czasie tworzenia klastra i nie można go zmienić później. Więcej informacji można znaleźć w egress outbound type.
| Wartość |
Opis |
|
loadBalancer
|
Moduł równoważenia obciążenia jest używany do ruchu wychodzącego za pośrednictwem publicznego adresu IP przypisanego przez usługę AKS. Obsługuje to usługi Kubernetes typu "loadBalancer". Aby uzyskać więcej informacji, zobacz typ obciążenia ruchu wychodzącego.
|
|
userDefinedRouting
|
Ścieżki ruchu wychodzącego muszą być zdefiniowane przez użytkownika. Jest to zaawansowany scenariusz i wymaga odpowiedniej konfiguracji sieci. Aby uzyskać więcej informacji, zobacz typ ruchu wychodzącego userDefinedRouting.
|
|
managedNATGateway
|
Brama translatora adresów sieciowych zarządzana przez usługę AKS jest używana do ruchu wychodzącego.
|
|
userAssignedNATGateway
|
Brama translatora adresów sieciowych przypisana przez użytkownika skojarzona z podsiecią klastra jest używana do ruchu wychodzącego. Jest to zaawansowany scenariusz i wymaga odpowiedniej konfiguracji sieci.
|
|
none
|
Klaster usługi AKS nie jest ustawiony z żadnym typem ruchu wychodzącego. Wszystkie węzły AKS mają domyślne zachowanie Azure VM wychodzące. Proszę zajrzeć do https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/
|
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 jest domyślny dla tego trybu, jeśli klient nie określi jawnie zasobnika podIPAllocationMode
|
|
StaticBlock
|
Każdy węzeł jest statycznie przydzielany blokom CIDR o rozmiarze /28 = 16 adresów IP na blok, aby spełnić wymagania maxPods na węzeł. Liczba bloków CIDR >= (maxPods / 16). Blok, a nie pojedynczy IP, liczy się do limitu IP Azure Vnet Private wynoszący 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
Objekt
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
Objekt
Opisuje stan zasilania klastra
| Nazwa |
Typ |
Opis |
|
code
|
Code
|
Informuje, czy klaster jest uruchomiony, czy zatrzymany
|
PrivateLinkResource
Objekt
Zasób łącza prywatnego
| Nazwa |
Typ |
Opis |
|
groupId
|
string
|
Identyfikator grupy zasobu.
|
|
id
|
string
|
ID zasobu private link.
|
|
name
|
string
|
Nazwa zasobu łącza prywatnego. Szczegóły można znaleźć w zasadach nazewnictwa .
|
|
privateLinkServiceID
|
string
(arm-id)
|
Identyfikator usługi łącza prywatnego zasobu, to pole jest uwidocznione tylko wewnętrznie dla dostawcy usług nrp.
|
|
requiredMembers
|
string[]
|
Liczba wymaganych elementów zasobu
|
|
type
|
string
|
Typ zasobu.
|
Protocol
Wyliczenie
Protokół sieciowy portu.
| Wartość |
Opis |
|
TCP
|
Protokół TCP.
|
|
UDP
|
Protokół UDP.
|
ProxyRedirectionMechanism
Wyliczenie
Tryb przekierowania ruchu.
| Wartość |
Opis |
|
InitContainers
|
Istio wstrzyknie kontener init do każdego zasobnika, aby przekierować ruch (wymaga NET_ADMIN i NET_RAW).
|
|
CNIChaining
|
Istio zainstaluje wtyczkę CNI w łańcuchu, aby przekierować ruch (zalecane).
|
PublicNetworkAccess
Wyliczenie
PublicNetworkAccess klastra zarządzanego. Zezwalaj lub odmawiaj access do sieci publicznej dla AKS
| Wartość |
Opis |
|
Enabled
|
Ruch przychodzący/wychodzący do zarządzanegoCluster jest dozwolony.
|
|
Disabled
|
Ruch przychodzący do listy managedCluster jest wyłączony, dozwolony jest ruch z zarządzanego klastra.
|
ResourceIdentityType
Wyliczenie
Typ tożsamości używany dla klastra zarządzanego. Więcej informacji można znaleźć w use managed identities in AKS.
| Wartość |
Opis |
|
SystemAssigned
|
Używanie niejawnie utworzonej tożsamości zarządzanej przypisanej przez system do zarządzania zasobami klastra. Komponenty główne w płaszczyźnie sterowania, takie jak kube-controller-manager, będą wykorzystywać przypisaną systemowi zarządzaną tożsamość do manipulowania zasobami Azure.
|
|
UserAssigned
|
Używanie tożsamości określonej przez użytkownika do zarządzania zasobami klastra. Komponenty główne w płaszczyźnie sterowania, takie jak kube-controller-manager, będą wykorzystywały określoną przez użytkownika zarządzaną tożsamość do manipulacji zasobami Azure.
|
|
None
|
Nie używaj tożsamości zarządzanej dla klastra zarządzanego, zamiast tego zostanie użyta jednostka usługi.
|
ResourceReference
Objekt
Odniesienie do zasobu Azure.
| Nazwa |
Typ |
Opis |
|
id
|
string
(arm-id)
|
W pełni kwalifikowane ID zasobów Azure.
|
RestrictionLevel
Wyliczenie
Poziom ograniczeń zastosowany do grupy zasobów węzła klastra. Jeśli nie zostanie określony, wartość domyślna to "Bez ograniczeń"
| Wartość |
Opis |
|
Unrestricted
|
Wszystkie uprawnienia kontroli dostępu opartej na rolach są dozwolone w grupie zasobów węzła zarządzanego
|
|
ReadOnly
|
Tylko */odczyt uprawnień RBAC dozwolonych w grupie zasobów węzła zarządzanego
|
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 rozpocząć cofanie przydziału wystąpień (jeśli istnieją) podczas skalowania w górę i cofania przydziału wystąpień podczas skalowania w dół.
|
ScaleProfile
Objekt
Specyfikacje dotyczące skalowania puli agentów VirtualMachines.
| Nazwa |
Typ |
Opis |
|
autoscale
|
AutoScaleProfile[]
|
Specyfikacje dotyczące automatycznego skalowania puli agentów VirtualMachines w ramach wstępnie zdefiniowanego zakresu rozmiarów.
Każdy profil celuje w konkretny SKKU VM i jest oceniany niezależnie.
Decyzje skalujące między profilami są regulowane przez rozszerzacz autoskalera klastra, konfigurowalny za pomocą ManagedCluster.properties.autoScalerProfile.expander.
|
|
manual
|
ManualScaleProfile[]
|
Specyfikacje dotyczące sposobu skalowania puli agentów VirtualMachines do stałego rozmiaru.
|
ScaleSetEvictionPolicy
Wyliczenie
Zasady eksmisji zestawu skalowania maszyn wirtualnych. Polityka eksmisji określa, co to do VM po jego eksmitacji. Wartość domyślna to Usuń. Więcej informacji o eksmisji można znaleźć w spot VMs
| Wartość |
Opis |
|
Delete
|
Węzły w bazowym zestawie skalowania puli węzłów są usuwane podczas eksmitowania.
|
|
Deallocate
|
Węzły w bazowym zestawie skalowania puli węzłów są ustawione na stan zatrzymanego 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 priorytcie 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.
|
SchedulerConfigMode
Wyliczenie
Tryb dostosowywania konfiguracji dla tego wystąpienia harmonogramu.
| Wartość |
Opis |
|
Default
|
Brak dostosowywania konfiguracji. Użyj konfiguracji domyślnej.
|
|
ManagedByCRD
|
Włącz dostosowywanie konfiguracji. Klient może określić konfigurację harmonogramu za pomocą CRD. Zobacz aka.ms/aks/scheduler-crd, aby uzyskać szczegółowe informacje.
|
SchedulerInstanceProfile
Objekt
Profil z ustawieniami związanymi z konkretną instancją harmonogramu zarządzanego przez AKS.
| Nazwa |
Typ |
Opis |
|
schedulerConfigMode
|
SchedulerConfigMode
|
Tryb konfiguracyjny przeznaczony do wykorzystania przez harmonogram zarządzany przez AKS.
|
SchedulerProfile
Objekt
Profil z ustawieniami związanymi z harmonogramem, takimi jak tryb konfiguracji dla każdego planisty zarządzany przez AKS. Zobacz: https://aka.ms/aks/scheduler-profile.
ServiceMeshMode
Wyliczenie
Tryb siatki usług.
| Wartość |
Opis |
|
Istio
|
Istio wdrożone jako dodatek usługi AKS.
|
|
Disabled
|
Siatka jest wyłączona.
|
ServiceMeshProfile
Objekt
Profil usługi Service Mesh dla klastra zarządzanego.
SysctlConfig
Objekt
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.
|
systemData
Objekt
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
| Nazwa |
Typ |
Opis |
|
createdAt
|
string
(date-time)
|
Sygnatura czasowa tworzenia zasobu (UTC).
|
|
createdBy
|
string
|
Tożsamość, która utworzyła zasób.
|
|
createdByType
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
|
lastModifiedAt
|
string
(date-time)
|
Znacznik czasu ostatniej modyfikacji zasobu (UTC)
|
|
lastModifiedBy
|
string
|
Tożsamość, która ostatnio zmodyfikowała zasób.
|
|
lastModifiedByType
|
createdByType
|
Typ tożsamości, która ostatnio zmodyfikowała zasób.
|
TransitEncryptionType
Wyliczenie
Konfiguruje szyfrowanie zasobników między zasobnikami. Można to włączyć tylko w klastrach opartych na cilium. Jeśli nie zostanie określony, wartość domyślna to Brak.
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 |
|
Cordon
|
Usługa AKS będzie kordonem zablokowanych węzłów 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.
|
|
Schedule
|
Usługa AKS oznaczy zablokowane węzły jako możliwe do schedulable, 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.
|
UpgradeChannel
Wyliczenie
Kanał uaktualniania na potrzeby automatycznego uaktualniania. Wartość domyślna to "none". Więcej informacji można znaleźć w setting the AKS auto-upgrade channel of cluster.
| Wartość |
Opis |
|
rapid
|
Automatycznie uaktualnij klaster do najnowszej obsługiwanej wersji poprawki w najnowszej obsługiwanej wersji pomocniczej. W przypadkach, gdy klaster znajduje się w wersji rozwiązania Kubernetes, która znajduje się w wersji pomocniczej N-2, w której N jest najnowszą obsługiwaną wersją pomocniczą, klaster najpierw uaktualnia do najnowszej obsługiwanej wersji poprawki w wersji pomocniczej N-1. Jeśli na przykład klaster działa w wersji 1.17.7 i w wersjach 1.17.9, 1.18.4, 1.18.6 i 1.19.1, klaster najpierw zostanie uaktualniony do wersji 1.18.6, a następnie zostanie uaktualniony do wersji 1.19.1.
|
|
stable
|
Automatycznie uaktualnij klaster do najnowszej obsługiwanej wersji poprawki w wersji pomocniczej N-1, gdzie N jest najnowszą obsługiwaną wersją pomocniczą. Jeśli na przykład klaster działa w wersji 1.17.7 i w wersjach 1.17.9, 1.18.4, 1.18.6 i 1.19.1, klaster zostanie uaktualniony do wersji 1.18.6.
|
|
patch
|
Automatycznie uaktualnij klaster do najnowszej obsługiwanej wersji poprawki, gdy stanie się ona dostępna, zachowując tę samą wersję pomocniczą. Jeśli na przykład klaster jest uruchomiony w wersji 1.17.7 i w wersjach 1.17.9, 1.18.4, 1.18.6 i 1.19.1, klaster zostanie uaktualniony do wersji 1.17.9.
|
|
node-image
|
Automatycznie uaktualnij obraz węzła do najnowszej dostępnej wersji. Rozważ użycie węzła NODEOSUpgradeChannel, ponieważ pozwala to skonfigurować stosowanie poprawek systemu operacyjnego węzła niezależnie od stosowania poprawek wersji platformy Kubernetes
|
|
none
|
Wyłącza automatyczne uaktualnianie i utrzymuje klaster w bieżącej wersji rozwiązania Kubernetes.
|
UpgradeOverrideSettings
Objekt
Ustawienia przesłonięć podczas uaktualniania klastra.
| Nazwa |
Typ |
Opis |
|
forceUpgrade
|
boolean
|
Czy wymusić uaktualnienie klastra. Należy pamiętać, że ta opcja instruuje operację uaktualniania, aby pominąć zabezpieczenia uaktualnienia, takie jak sprawdzanie przestarzałego użycia interfejsu API. Włącz tę opcję tylko z ostrożnością.
|
|
until
|
string
(date-time)
|
Do momentu, gdy przesłonięcia są skuteczne. Należy pamiętać, że jest to zgodne tylko z godziną rozpoczęcia uaktualnienia, a skuteczność nie zmieni się po uruchomieniu uaktualnienia, nawet jeśli until uaktualnienie wygaśnie po zakończeniu uaktualniania. To pole nie jest domyślnie ustawione. Aby przesłonięcia zaczęły obowiązywać, należy go ustawić.
|
UserAssignedIdentity
Objekt
Szczegółowe informacje o tożsamości przypisanej przez użytkownika.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
|
Identyfikator klienta tożsamości przypisanej przez użytkownika.
|
|
objectId
|
string
|
Identyfikator obiektu tożsamości przypisanej przez użytkownika.
|
|
resourceId
|
string
(arm-id)
|
Identyfikator zasobu tożsamości przypisanej przez użytkownika.
|
VirtualMachineNodes
Objekt
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
Objekt
Specyfikacje w puli agentów VirtualMachines.
| Nazwa |
Typ |
Opis |
|
scale
|
ScaleProfile
|
Specyfikacje dotyczące skalowania puli agentów VirtualMachines.
|
WindowsGmsaProfile
Objekt
Profil Windows gMSA w zarządzanym klastrze.
| Nazwa |
Typ |
Opis |
|
dnsServer
|
string
|
Określa serwer DNS dla systemu Windows gMSA.
Ustaw ją na pustą, jeśli skonfigurowano serwer DNS w sieci wirtualnej, która jest używana do tworzenia klastra zarządzanego.
|
|
enabled
|
boolean
|
Czy włączyć gMSA systemu Windows. Określa, czy włączyć grupę zarządzania systemem Windows w klastrze zarządzanym.
|
|
rootDomainName
|
string
|
Określa nazwę domeny głównej dla gMSA systemu Windows.
Ustaw ją na pustą, jeśli skonfigurowano serwer DNS w sieci wirtualnej, która jest używana do tworzenia klastra zarządzanego.
|
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 Hyper-V, sam system operacyjny węzła AKS jest zagnieżdżonym systemem wirtualnym (systemem root) 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.
|