Создает или обновляет пул агентов в указанном управляемом кластере.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}?api-version=2024-05-01
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
agentPoolName
|
path |
True
|
string
|
Имя пула агентов.
Шаблон регулярного выражения: ^[a-z][a-z0-9]{0,11}$
|
resourceGroupName
|
path |
True
|
string
|
Имя группы ресурсов. Имя не учитывает регистр.
|
resourceName
|
path |
True
|
string
|
Имя ресурса управляемого кластера.
Шаблон регулярного выражения: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$
|
subscriptionId
|
path |
True
|
string
uuid
|
Идентификатор целевой подписки. Значение должно быть UUID.
|
api-version
|
query |
True
|
string
|
Версия API, используемая для этой операции.
|
Текст запроса
Имя |
Тип |
Описание |
properties.availabilityZones
|
string[]
|
Список зон доступности, используемых для узлов. Это можно указать, только если свойство AgentPoolType — VirtualMachineScaleSets.
|
properties.capacityReservationGroupID
|
string
|
Полный идентификатор ресурса группы резервирования емкости для предоставления виртуальных машин из зарезервированной группы виртуальных машин.
AKS связывает указанный пул агентов с группой резервирования емкости.
|
properties.count
|
integer
|
Количество агентов (виртуальных машин) для размещения контейнеров Docker. Допустимые значения должны находиться в диапазоне от 0 до 1000 (включительно) для пулов пользователей и в диапазоне от 1 до 1000 (включительно) для системных пулов. Значение по умолчанию — 1.
|
properties.creationData
|
CreationData
|
Создание данных, используемых для указания исходного идентификатора моментального снимка, если пул узлов будет создан или обновлен с помощью моментального снимка.
|
properties.enableAutoScaling
|
boolean
|
Включение автоматического масштабирования
|
properties.enableEncryptionAtHost
|
boolean
|
Следует ли включить шифрование дисков на основе узла и ОС.
Это поддерживается только в определенных размерах виртуальных машин и в определенных регионах Azure. Дополнительные сведения см. в статье https://docs.microsoft.com/azure/aks/enable-host-encryption
|
properties.enableFIPS
|
boolean
|
Следует ли использовать ОС с поддержкой FIPS.
Дополнительные сведения см. в статье Добавление пула узлов с поддержкой FIPS.
|
properties.enableNodePublicIP
|
boolean
|
Выделяется ли каждый узел собственным общедоступным IP-адресом.
В некоторых сценариях может потребоваться, чтобы узлы в пуле узлов получали собственные выделенные общедоступные IP-адреса. Распространенный сценарий — для игровых рабочих нагрузок, где консоль должна сделать прямое подключение к облачной виртуальной машине, чтобы свести к минимуму прыжки. Дополнительные сведения см. в назначении общедоступного IP-адреса наузла. Значение по умолчанию — false.
|
properties.enableUltraSSD
|
boolean
|
Включение UltraSSD
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
GPUInstanceProfile для указания профиля экземпляра GPU MIG для поддерживаемого номера SKU виртуальной машины GPU.
|
properties.hostGroupID
|
string
|
Полный идентификатор ресурса выделенной группы узлов для подготовки виртуальных машин, используемый только в сценарии создания и не допуская изменения после установки.
Это форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. Дополнительные сведения см. в выделенных узлах Azure.
|
properties.kubeletConfig
|
KubeletConfig
|
Конфигурации Kubelet узлов агента.
Конфигурация Kubelet на узлах пула агентов.
|
properties.kubeletDiskType
|
KubeletDiskType
|
Определяет размещение томов emptyDir, корневого каталога данных среды выполнения контейнера и эфемерного хранилища Kubelet.
|
properties.linuxOSConfig
|
LinuxOSConfig
|
Конфигурации ОС узлов агента Linux.
Конфигурация ОС узлов агента Linux.
|
properties.maxCount
|
integer
|
Максимальное количество узлов для автоматического масштабирования
|
properties.maxPods
|
integer
|
Максимальное количество модулей pod, которые могут выполняться на узле.
|
properties.minCount
|
integer
|
Минимальное количество узлов для автоматического масштабирования
|
properties.mode
|
AgentPoolMode
|
Режим пула агентов.
Кластер должен иметь по крайней мере один пул агентов System. Дополнительные сведения об ограничениях пула агентов и рекомендациях см. в статье https://docs.microsoft.com/azure/aks/use-system-pools
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
Параметры пула агентов, связанные с сетью.
|
properties.nodeLabels
|
object
|
Метки узлов, которые необходимо сохранить во всех узлах в пуле агентов.
|
properties.nodePublicIPPrefixID
|
string
|
Идентификатор префикса общедоступного IP-адреса, из которого узлы виртуальной машины должны использовать IP-адреса.
Это форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}
|
properties.nodeTaints
|
string[]
|
Фрагменты, добавленные к новым узлам во время создания и масштабирования пула узлов. Например, key=value:NoSchedule.
|
properties.orchestratorVersion
|
string
|
Версия Kubernetes, указанная пользователем.
Поддерживаются оба исправления <major.minor.patch> (например, 1.20.13) и <основных.дополнительных> (например, 1.20). Если указан <основной.дополнительный>, то последняя поддерживаемая версия исправления общедоступной версии выбирается автоматически. Обновление кластера с тем же <основной.дополнительный> после его создания (например, 1.14.x -> 1.14) не активирует обновление, даже если новая версия исправлений доступна. Рекомендуется обновить все пулы узлов в кластере AKS до той же версии Kubernetes. Версия пула узлов должна иметь ту же основную версию, что и плоскость управления. Дополнительная версия пула узлов должна находиться в двух дополнительных версиях версии уровня управления. Версия пула узлов не может быть больше версии уровня управления. Дополнительные сведения см. в обновлении пула узлов.
|
properties.osDiskSizeGB
|
integer
|
Размер диска ОС в ГБ, используемый для указания размера диска для каждого компьютера в пуле главных и агентов. Если указать значение 0, он будет применять размер osDisk по умолчанию в соответствии с указанным vmSize.
|
properties.osDiskType
|
OSDiskType
|
Тип диска ОС, используемый для компьютеров в пуле агентов.
Значение по умолчанию — "Ephemeral", если виртуальная машина поддерживает ее и имеет диск кэша больше запрошенного OSDiskSizeGB. В противном случае значение по умолчанию — Managed. Может не быть изменено после создания. Дополнительные сведения см. в эфемерной ОС.
|
properties.osSKU
|
OSSKU
|
Указывает номер SKU ОС, используемый пулом агентов. По умолчанию используется Ubuntu, если OSType — Linux. По умолчанию используется Windows2019, если Kubernetes <= 1.24 или Windows2022, если Kubernetes >= 1,25, если OSType — Windows.
|
properties.osType
|
OSType
|
Тип операционной системы. По умолчанию используется Linux.
|
properties.podSubnetID
|
string
|
Идентификатор подсети, к которой будут присоединяться модули pod при запуске.
Если не указано, IP-адреса pod статически назначаются в подсети узла (дополнительные сведения см. в статье vnetSubnetID). Эта форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
properties.powerState
|
PowerState
|
Выполняется или останавливается ли пул агентов.
При первом создании пула агентов он изначально выполняется. Пул агентов можно остановить, установив для этого поля значение "Остановлено". Остановленный пул агентов останавливает все виртуальные машины и не взимает плата за выставление счетов. Пул агентов может быть остановлен только в том случае, если оно запущено и состояние подготовки выполнено успешно.
|
properties.proximityPlacementGroupID
|
string
|
Идентификатор группы размещения близкого взаимодействия.
|
properties.scaleDownMode
|
ScaleDownMode
|
Режим уменьшения масштаба, используемый при масштабировании пула агентов.
Это также влияет на поведение автомасштабирования кластера. Если он не указан, по умолчанию используется значение Delete.
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Политика вытеснения масштабируемого набора виртуальных машин.
Это нельзя указать, если параметр scaleSetPriority не имеет значения Spot. Если значение не указано, значение по умолчанию — "Удалить".
|
properties.scaleSetPriority
|
ScaleSetPriority
|
Приоритет масштабируемого набора виртуальных машин. Если значение не указано, значение по умолчанию — "Regular".
|
properties.spotMaxPrice
|
number
|
Максимальная цена (в долларах США) вы готовы платить за точечные экземпляры. Возможные значения — это любое десятичное значение больше нуля или -1, указывающее, что цена по умолчанию up-to по запросу.
Возможные значения — это любое десятичное значение, больше нуля или -1 которое указывает на готовность платить любую цену по запросу. Дополнительные сведения о ценах на точечные виртуальные машины см. в цен на точечные виртуальные машины
|
properties.tags
|
object
|
Теги, которые необходимо сохранить в масштабируемом наборе виртуальных машин пула агентов.
|
properties.type
|
AgentPoolType
|
Тип пула агентов.
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
Параметры обновления агентаpool
|
properties.vmSize
|
string
|
Размер виртуальных машин пула агентов.
Доступность размера виртуальной машины зависит от региона. Если узел содержит недостаточные вычислительные ресурсы (память, ЦП и т. д.), модули pod могут не выполняться правильно. Дополнительные сведения об ограниченных размерах виртуальных машин см. в статье https://docs.microsoft.com/azure/aks/quotas-skus-regions
|
properties.vnetSubnetID
|
string
|
Идентификатор подсети, в которой узлы пула агентов и при необходимости модули pod присоединяются при запуске.
Если это не указано, будет создана и используется виртуальная сеть и подсеть. Если параметр podSubnetID не указан, это относится к узлам и модулям pod, в противном случае оно применяется только к узлам. Эта форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
Конкретный профиль пула агентов Windows.
|
properties.workloadRuntime
|
WorkloadRuntime
|
Определяет тип рабочей нагрузки, который может выполнять узел.
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
AgentPool
|
Существующий пул агентов успешно обновлен.
|
201 Created
|
AgentPool
|
Новый пул агентов успешно создан.
|
Other Status Codes
|
CloudError
|
Ответ на ошибку, описывающий причину сбоя операции.
|
Безопасность
azure_auth
Поток OAuth2 Azure Active Directory
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
Create Agent Pool using an agent pool snapshot
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.CreationData;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_Snapshot.json
*/
/**
* Sample code: Create Agent Pool using an agent pool snapshot.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolUsingAnAgentPoolSnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools()
.createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableFips(true)
.withCreationData(new CreationData().withSourceResourceId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_snapshot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
},
"enableFIPS": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Snapshot.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Snapshot.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
CreationData: &armcontainerservice.CreationData{
SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
},
EnableFIPS: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CreationData: &armcontainerservice.CreationData{
// SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"),
// },
// CurrentOrchestratorVersion: to.Ptr("1.19.6"),
// EnableFIPS: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Snapshot.json
*/
async function createAgentPoolUsingAnAgentPoolSnapshot() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
creationData: {
sourceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1",
},
enableFips: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true,
"creationData": {
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"
}
}
}
Create Agent Pool with Capacity Reservation Group
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_CRG.json
*/
/**
* Sample code: Create Agent Pool with Capacity Reservation Group.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createAgentPoolWithCapacityReservationGroup(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("").withCapacityReservationGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_crg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CRG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CRG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityReservationGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"),
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CRG.json
*/
async function createAgentPoolWithCapacityReservationGroup() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
capacityReservationGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1",
count: 3,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"
}
}
Create Agent Pool with Dedicated Host Group
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_DedicatedHostGroup.json
*/
/**
* Sample code: Create Agent Pool with Dedicated Host Group.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithDedicatedHostGroup(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools()
.createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("").withHostGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_dedicated_host_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_DedicatedHostGroup.json
*/
async function createAgentPoolWithDedicatedHostGroup() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
hostGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1",
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"hostGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"
}
}
Create Agent Pool with EncryptionAtHost enabled
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_EnableEncryptionAtHost.json
*/
/**
* Sample code: Create Agent Pool with EncryptionAtHost enabled.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createAgentPoolWithEncryptionAtHostEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableEncryptionAtHost(true),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_encryption_at_host.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableEncryptionAtHost": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableEncryptionAtHost: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.13"),
// EnableEncryptionAtHost: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.13"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
*/
async function createAgentPoolWithEncryptionAtHostEnabled() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableEncryptionAtHost: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableEncryptionAtHost": true
}
}
Create Agent Pool with Ephemeral OS Disk
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osDiskType": "Ephemeral",
"osDiskSizeGB": 64
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSDiskType;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_Ephemeral.json
*/
/**
* Sample code: Create Agent Pool with Ephemeral OS Disk.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithEphemeralOSDisk(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsDiskSizeGB(64)
.withOsDiskType(OSDiskType.EPHEMERAL).withOsType(OSType.LINUX).withOrchestratorVersion(""),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ephemeral.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osDiskType": "Ephemeral",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Ephemeral.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Ephemeral.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsDisk() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSDiskSizeGB: to.Ptr[int32](64),
OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSDiskSizeGB: to.Ptr[int32](64),
// OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Ephemeral.json
*/
async function createAgentPoolWithEphemeralOSDisk() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
orchestratorVersion: "",
osDiskSizeGB: 64,
osDiskType: "Ephemeral",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskType": "Ephemeral",
"osDiskSizeGB": 64
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskType": "Ephemeral",
"kubeletDiskType": "OS",
"osDiskSizeGB": 64
}
}
Create Agent Pool with FIPS enabled OS
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableFIPS": true
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_EnableFIPS.json
*/
/**
* Sample code: Create Agent Pool with FIPS enabled OS.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithFIPSEnabledOS(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableFips(true),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_fips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableFIPS": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableFIPS.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableFIPS.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableFIPS: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.19.6"),
// EnableFIPS: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.19.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableFIPS.json
*/
async function createAgentPoolWithFipsEnabledOS() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableFips: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.19.6",
"currentOrchestratorVersion": "1.19.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableFIPS": true
}
}
Create Agent Pool with GPUMIG
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.GpuInstanceProfile;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_GPUMIG.json
*/
/**
* Sample code: Create Agent Pool with GPUMIG.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithGPUMIG(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools()
.createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3)
.withVmSize("Standard_ND96asr_v4").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500))
.withGpuInstanceProfile(GpuInstanceProfile.MIG2G), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_gpumig.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_ND96asr_v4",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_GPUMIG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_GPUMIG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn")},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_ND96asr_v4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn")},
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_ND96asr_v4"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_GPUMIG.json
*/
async function createAgentPoolWithGpumig() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
gpuInstanceProfile: "MIG2g",
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_ND96asr_v4",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"maxPods": 110,
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_ND96asr_v4",
"maxPods": 110,
"osType": "Linux",
"gpuInstanceProfile": "MIG2g",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with Krustlet and the WASI runtime
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.WorkloadRuntime;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_WasmWasi.json
*/
/**
* Sample code: Create Agent Pool with Krustlet and the WASI runtime.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createAgentPoolWithKrustletAndTheWASIRuntime(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsDiskSizeGB(64)
.withWorkloadRuntime(WorkloadRuntime.WASM_WASI).withOsType(OSType.LINUX).withMode(AgentPoolMode.USER)
.withOrchestratorVersion(""),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_wasm_wasi.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"mode": "User",
"orchestratorVersion": "",
"osDiskSizeGB": 64,
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
"workloadRuntime": "WasmWasi",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WasmWasi.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WasmWasi.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
OrchestratorVersion: to.Ptr(""),
OSDiskSizeGB: to.Ptr[int32](64),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSDiskSizeGB: to.Ptr[int32](64),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WasmWasi.json
*/
async function createAgentPoolWithKrustletAndTheWasiRuntime() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
mode: "User",
orchestratorVersion: "",
osDiskSizeGB: 64,
osType: "Linux",
vmSize: "Standard_DS2_v2",
workloadRuntime: "WasmWasi",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osDiskSizeGB": 64,
"mode": "User",
"workloadRuntime": "WasmWasi"
}
}
Create Agent Pool with KubeletConfig and LinuxOSConfig
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_CustomNodeConfig.json
*/
/**
* Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createAgentPoolWithKubeletConfigAndLinuxOSConfig(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools()
.createOrUpdate("rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3)
.withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX).withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_custom_node_config.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CustomNodeConfig.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CustomNodeConfig.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOsConfig() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn")},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn")},
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CustomNodeConfig.json
*/
async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with OSSKU
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.KubeletConfig;
import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.SysctlConfig;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_OSSKU.json
*/
/**
* Sample code: Create Agent Pool with OSSKU.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithOSSKU(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOsSku(OSSku.AZURE_LINUX).withOrchestratorVersion("")
.withKubeletConfig(new KubeletConfig().withCpuManagerPolicy("static").withCpuCfsQuota(true)
.withCpuCfsQuotaPeriod("200ms").withImageGcHighThreshold(90).withImageGcLowThreshold(70)
.withTopologyManagerPolicy("best-effort")
.withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")).withFailSwapOn(false))
.withLinuxOSConfig(new LinuxOSConfig()
.withSysctls(new SysctlConfig().withNetCoreWmemDefault(12345).withNetIpv4TcpTwReuse(true)
.withNetIpv4IpLocalPortRange("20000 60000").withKernelThreadsMax(99999))
.withTransparentHugePageEnabled("always").withTransparentHugePageDefrag("madvise")
.withSwapFileSizeMB(1500)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ossku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"kubeletConfig": {
"allowedUnsafeSysctls": ["kernel.msg*", "net.core.somaxconn"],
"cpuCfsQuota": True,
"cpuCfsQuotaPeriod": "200ms",
"cpuManagerPolicy": "static",
"failSwapOn": False,
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
},
"linuxOSConfig": {
"swapFileSizeMB": 1500,
"sysctls": {
"kernelThreadsMax": 99999,
"netCoreWmemDefault": 12345,
"netIpv4IpLocalPortRange": "20000 60000",
"netIpv4TcpTwReuse": True,
},
"transparentHugePageDefrag": "madvise",
"transparentHugePageEnabled": "always",
},
"orchestratorVersion": "",
"osSKU": "AzureLinux",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_OSSKU.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_OSSKU.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
KubeletConfig: &armcontainerservice.KubeletConfig{
AllowedUnsafeSysctls: []*string{
to.Ptr("kernel.msg*"),
to.Ptr("net.core.somaxconn")},
CPUCfsQuota: to.Ptr(true),
CPUCfsQuotaPeriod: to.Ptr("200ms"),
CPUManagerPolicy: to.Ptr("static"),
FailSwapOn: to.Ptr(false),
ImageGcHighThreshold: to.Ptr[int32](90),
ImageGcLowThreshold: to.Ptr[int32](70),
TopologyManagerPolicy: to.Ptr("best-effort"),
},
LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
SwapFileSizeMB: to.Ptr[int32](1500),
Sysctls: &armcontainerservice.SysctlConfig{
KernelThreadsMax: to.Ptr[int32](99999),
NetCoreWmemDefault: to.Ptr[int32](12345),
NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
NetIPv4TCPTwReuse: to.Ptr(true),
},
TransparentHugePageDefrag: to.Ptr("madvise"),
TransparentHugePageEnabled: to.Ptr("always"),
},
OrchestratorVersion: to.Ptr(""),
OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.8"),
// KubeletConfig: &armcontainerservice.KubeletConfig{
// AllowedUnsafeSysctls: []*string{
// to.Ptr("kernel.msg*"),
// to.Ptr("net.core.somaxconn")},
// CPUCfsQuota: to.Ptr(true),
// CPUCfsQuotaPeriod: to.Ptr("200ms"),
// CPUManagerPolicy: to.Ptr("static"),
// FailSwapOn: to.Ptr(false),
// ImageGcHighThreshold: to.Ptr[int32](90),
// ImageGcLowThreshold: to.Ptr[int32](70),
// TopologyManagerPolicy: to.Ptr("best-effort"),
// },
// LinuxOSConfig: &armcontainerservice.LinuxOSConfig{
// SwapFileSizeMB: to.Ptr[int32](1500),
// Sysctls: &armcontainerservice.SysctlConfig{
// KernelThreadsMax: to.Ptr[int32](99999),
// NetCoreWmemDefault: to.Ptr[int32](12345),
// NetIPv4IPLocalPortRange: to.Ptr("20000 60000"),
// NetIPv4TCPTwReuse: to.Ptr(true),
// },
// TransparentHugePageDefrag: to.Ptr("madvise"),
// TransparentHugePageEnabled: to.Ptr("always"),
// },
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.8"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_OSSKU.json
*/
async function createAgentPoolWithOssku() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
kubeletConfig: {
allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"],
cpuCfsQuota: true,
cpuCfsQuotaPeriod: "200ms",
cpuManagerPolicy: "static",
failSwapOn: false,
imageGcHighThreshold: 90,
imageGcLowThreshold: 70,
topologyManagerPolicy: "best-effort",
},
linuxOSConfig: {
swapFileSizeMB: 1500,
sysctls: {
kernelThreadsMax: 99999,
netCoreWmemDefault: 12345,
netIpv4IpLocalPortRange: "20000 60000",
netIpv4TcpTwReuse: true,
},
transparentHugePageDefrag: "madvise",
transparentHugePageEnabled: "always",
},
orchestratorVersion: "",
osSKU: "AzureLinux",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 12345,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.8",
"currentOrchestratorVersion": "1.17.8",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"osSKU": "AzureLinux",
"kubeletConfig": {
"cpuManagerPolicy": "static",
"cpuCfsQuota": true,
"cpuCfsQuotaPeriod": "200ms",
"imageGcHighThreshold": 90,
"imageGcLowThreshold": 70,
"topologyManagerPolicy": "best-effort",
"allowedUnsafeSysctls": [
"kernel.msg*",
"net.core.somaxconn"
],
"failSwapOn": false,
"podMaxPids": 100
},
"linuxOSConfig": {
"sysctls": {
"netCoreWmemDefault": 65536,
"netIpv4TcpTwReuse": true,
"netIpv4IpLocalPortRange": "20000 60000",
"kernelThreadsMax": 99999
},
"transparentHugePageEnabled": "always",
"transparentHugePageDefrag": "madvise",
"swapFileSizeMB": 1500
}
}
}
Create Agent Pool with PPG
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_PPG.json
*/
/**
* Sample code: Create Agent Pool with PPG.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithPPG(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("").withProximityPlacementGroupId(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_ppg.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "",
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_PPG.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_PPG.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_PPG.json
*/
async function createAgentPoolWithPpg() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
orchestratorVersion: "",
osType: "Linux",
proximityPlacementGroupID:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"proximityPlacementGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"
}
}
Create Agent Pool with UltraSSD enabled
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS2_v2",
"osType": "Linux",
"enableUltraSSD": true
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_EnableUltraSSD.json
*/
/**
* Sample code: Create Agent Pool with UltraSSD enabled.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithUltraSSDEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "agentpool1", new AgentPoolInner().withCount(3).withVmSize("Standard_DS2_v2")
.withOsType(OSType.LINUX).withOrchestratorVersion("").withEnableUltraSsd(true),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_enable_ultra_ssd.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableUltraSSD": True,
"orchestratorVersion": "",
"osType": "Linux",
"vmSize": "Standard_DS2_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableUltraSSD.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableUltraSSD.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableUltraSSD: to.Ptr(true),
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
VMSize: to.Ptr("Standard_DS2_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.17.13"),
// EnableUltraSSD: to.Ptr(true),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.17.13"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_DS2_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableUltraSSD.json
*/
async function createAgentPoolWithUltraSsdEnabled() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableUltraSSD: true,
orchestratorVersion: "",
osType: "Linux",
vmSize: "Standard_DS2_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableUltraSSD": true
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.17.13",
"currentOrchestratorVersion": "1.17.13",
"count": 3,
"vmSize": "Standard_DS2_v2",
"maxPods": 110,
"osType": "Linux",
"enableUltraSSD": true
}
}
Create Agent Pool with Windows OSSKU
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"osType": "Windows",
"osSKU": "Windows2022"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_WindowsOSSKU.json
*/
/**
* Sample code: Create Agent Pool with Windows OSSKU.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createAgentPoolWithWindowsOSSKU(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate(
"rg1", "clustername1", "wnp2", new AgentPoolInner().withCount(3).withVmSize("Standard_D4s_v3")
.withOsType(OSType.WINDOWS).withOsSku(OSSku.WINDOWS2022).withOrchestratorVersion("1.23.3"),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_windows_ossku.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="wnp2",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "1.23.3",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsOSSKU.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsOSSKU.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "wnp2", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr("1.23.3"),
OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
OSType: to.Ptr(armcontainerservice.OSTypeWindows),
VMSize: to.Ptr("Standard_D4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("wnp2"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.23.3"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.23.3"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
// OSType: to.Ptr(armcontainerservice.OSTypeWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_D4s_v3"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsOSSKU.json
*/
async function createAgentPoolWithWindowsOssku() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "wnp2";
const parameters = {
count: 3,
orchestratorVersion: "1.23.3",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.23.3",
"currentOrchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.23.3",
"currentOrchestratorVersion": "1.23.3",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022"
}
}
Create Spot Agent Pool
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_Spot.json
*/
/**
* Sample code: Create Spot Agent Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createSpotAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withOrchestratorVersion("").withScaleSetPriority(ScaleSetPriority.SPOT)
.withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE).withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_spot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {"name1": "val1"},
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Spot.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Spot.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule")},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule")},
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// SpotMaxPrice: to.Ptr[float32](-1),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Spot.json
*/
async function createSpotAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
tags: { name1: "val1" },
vmSize: "Standard_DS1_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"spotMaxPrice": -1
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"spotMaxPrice": -1
}
}
Create Windows Agent Pool with disabling OutboundNAT
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolWindowsProfile;
import com.azure.resourcemanager.containerservice.models.OSSku;
import com.azure.resourcemanager.containerservice.models.OSType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_WindowsDisableOutboundNAT.json
*/
/**
* Sample code: Create Windows Agent Pool with disabling OutboundNAT.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
createWindowsAgentPoolWithDisablingOutboundNAT(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"wnp2",
new AgentPoolInner().withCount(3).withVmSize("Standard_D4s_v3").withOsType(OSType.WINDOWS)
.withOsSku(OSSku.WINDOWS2022).withOrchestratorVersion("1.23.8").withWindowsProfile(
new AgentPoolWindowsProfile().withDisableOutboundNat(true)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_windows_disable_outbound_nat.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="wnp2",
parameters={
"properties": {
"count": 3,
"orchestratorVersion": "1.23.8",
"osSKU": "Windows2022",
"osType": "Windows",
"vmSize": "Standard_D4s_v3",
"windowsProfile": {"disableOutboundNat": True},
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisablingOutboundNat() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "wnp2", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
OrchestratorVersion: to.Ptr("1.23.8"),
OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
OSType: to.Ptr(armcontainerservice.OSTypeWindows),
VMSize: to.Ptr("Standard_D4s_v3"),
WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{
DisableOutboundNat: to.Ptr(true),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("wnp2"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.23.8"),
// MaxPods: to.Ptr[int32](110),
// OrchestratorVersion: to.Ptr("1.23.8"),
// OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022),
// OSType: to.Ptr(armcontainerservice.OSTypeWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// VMSize: to.Ptr("Standard_D4s_v3"),
// WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{
// DisableOutboundNat: to.Ptr(true),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json
*/
async function createWindowsAgentPoolWithDisablingOutboundNat() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "wnp2";
const parameters = {
count: 3,
orchestratorVersion: "1.23.8",
osSKU: "Windows2022",
osType: "Windows",
vmSize: "Standard_D4s_v3",
windowsProfile: { disableOutboundNat: true },
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.23.8",
"currentOrchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "wnp2",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.23.8",
"currentOrchestratorVersion": "1.23.8",
"count": 3,
"vmSize": "Standard_D4s_v3",
"maxPods": 110,
"osType": "Windows",
"osSKU": "Windows2022",
"windowsProfile": {
"disableOutboundNat": true
}
}
}
Create/Update Agent Pool
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPoolsCreate_Update.json
*/
/**
* Sample code: Create/Update Agent Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createUpdateAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX)
.withMode(AgentPoolMode.USER).withOrchestratorVersion("").withScaleSetPriority(ScaleSetPriority.SPOT)
.withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE).withTags(mapOf("name1", "val1"))
.withNodeLabels(mapOf("key1", "fakeTokenPlaceholder"))
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_create_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"mode": "User",
"nodeLabels": {"key1": "val1"},
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"tags": {"name1": "val1"},
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Update.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Update.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
NodeLabels: map[string]*string{
"key1": to.Ptr("val1"),
},
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule")},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
Tags: map[string]*string{
"name1": to.Ptr("val1"),
},
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// MaxPods: to.Ptr[int32](110),
// Mode: to.Ptr(armcontainerservice.AgentPoolModeUser),
// NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"),
// NodeLabels: map[string]*string{
// "key1": to.Ptr("val1"),
// },
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule")},
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// Tags: map[string]*string{
// "name1": to.Ptr("val1"),
// },
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Update.json
*/
async function createOrUpdateAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
mode: "User",
nodeLabels: { key1: "val1" },
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
tags: { name1: "val1" },
vmSize: "Standard_DS1_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User",
"nodeImageVersion": "AKSUbuntu:1604:2020.03.11"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Creating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"tags": {
"name1": "val1"
},
"nodeLabels": {
"key1": "val1"
},
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete",
"mode": "User"
}
}
Start Agent Pool
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"powerState": {
"code": "Running"
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.Code;
import com.azure.resourcemanager.containerservice.models.PowerState;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPools_Start.json
*/
/**
* Sample code: Start Agent Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void startAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1", new AgentPoolInner().withPowerState(new PowerState().withCode(Code.RUNNING)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_start.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={"properties": {"powerState": {"code": "Running"}}},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Start.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Start.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
PowerState: &armcontainerservice.PowerState{
Code: to.Ptr(armcontainerservice.CodeRunning),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](50),
// EnableAutoScaling: to.Ptr(true),
// MaxCount: to.Ptr[int32](55),
// MinCount: to.Ptr[int32](3),
// PowerState: &armcontainerservice.PowerState{
// Code: to.Ptr(armcontainerservice.CodeRunning),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Start.json
*/
async function startAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = { powerState: { code: "Running" } };
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Starting",
"count": 50,
"enableAutoScaling": true,
"minCount": 3,
"maxCount": 55,
"powerState": {
"code": "Running"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Starting",
"count": 50,
"enableAutoScaling": true,
"minCount": 3,
"maxCount": 55,
"powerState": {
"code": "Running"
}
}
}
Stop Agent Pool
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"powerState": {
"code": "Stopped"
}
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.Code;
import com.azure.resourcemanager.containerservice.models.PowerState;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPools_Stop.json
*/
/**
* Sample code: Stop Agent Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void stopAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1", new AgentPoolInner().withPowerState(new PowerState().withCode(Code.STOPPED)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_stop.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={"properties": {"powerState": {"code": "Stopped"}}},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Stop.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Stop.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
PowerState: &armcontainerservice.PowerState{
Code: to.Ptr(armcontainerservice.CodeStopped),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](0),
// EnableAutoScaling: to.Ptr(false),
// PowerState: &armcontainerservice.PowerState{
// Code: to.Ptr(armcontainerservice.CodeStopped),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Stop.json
*/
async function stopAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = { powerState: { code: "Stopped" } };
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Stopping",
"count": 0,
"enableAutoScaling": false,
"minCount": null,
"maxCount": null,
"powerState": {
"code": "Stopped"
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Stopping",
"count": 0,
"enableAutoScaling": false,
"minCount": null,
"maxCount": null,
"powerState": {
"code": "Stopped"
}
}
}
Update Agent Pool
Образец запроса
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1?api-version=2024-05-01
{
"properties": {
"orchestratorVersion": "",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.containerservice.models.OSType;
import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for AgentPools CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/
* AgentPools_Update.json
*/
/**
* Sample code: Update Agent Pool.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getAgentPools().createOrUpdate("rg1", "clustername1",
"agentpool1",
new AgentPoolInner().withCount(3).withVmSize("Standard_DS1_v2").withOsType(OSType.LINUX).withMaxCount(2)
.withMinCount(2).withEnableAutoScaling(true).withOrchestratorVersion("")
.withScaleSetPriority(ScaleSetPriority.SPOT).withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE)
.withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python agent_pools_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.agent_pools.begin_create_or_update(
resource_group_name="rg1",
resource_name="clustername1",
agent_pool_name="agentpool1",
parameters={
"properties": {
"count": 3,
"enableAutoScaling": True,
"maxCount": 2,
"minCount": 2,
"nodeTaints": ["Key1=Value1:NoSchedule"],
"orchestratorVersion": "",
"osType": "Linux",
"scaleSetEvictionPolicy": "Delete",
"scaleSetPriority": "Spot",
"vmSize": "Standard_DS1_v2",
}
},
).result()
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Update.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Update.json
func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{
Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
Count: to.Ptr[int32](3),
EnableAutoScaling: to.Ptr(true),
MaxCount: to.Ptr[int32](2),
MinCount: to.Ptr[int32](2),
NodeTaints: []*string{
to.Ptr("Key1=Value1:NoSchedule")},
OrchestratorVersion: to.Ptr(""),
OSType: to.Ptr(armcontainerservice.OSTypeLinux),
ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
VMSize: to.Ptr("Standard_DS1_v2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AgentPool = armcontainerservice.AgentPool{
// Name: to.Ptr("agentpool1"),
// Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"),
// Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{
// Count: to.Ptr[int32](3),
// CurrentOrchestratorVersion: to.Ptr("1.9.6"),
// EnableAutoScaling: to.Ptr(true),
// MaxCount: to.Ptr[int32](2),
// MaxPods: to.Ptr[int32](110),
// MinCount: to.Ptr[int32](2),
// NodeTaints: []*string{
// to.Ptr("Key1=Value1:NoSchedule")},
// OrchestratorVersion: to.Ptr("1.9.6"),
// OSType: to.Ptr(armcontainerservice.OSTypeLinux),
// ProvisioningState: to.Ptr("Succeeded"),
// ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete),
// ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot),
// VMSize: to.Ptr("Standard_DS1_v2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster.
*
* @summary Creates or updates an agent pool in the specified managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Update.json
*/
async function updateAgentPool() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const agentPoolName = "agentpool1";
const parameters = {
count: 3,
enableAutoScaling: true,
maxCount: 2,
minCount: 2,
nodeTaints: ["Key1=Value1:NoSchedule"],
orchestratorVersion: "",
osType: "Linux",
scaleSetEvictionPolicy: "Delete",
scaleSetPriority: "Spot",
vmSize: "Standard_DS1_v2",
};
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.agentPools.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
agentPoolName,
parameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Succeeded",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1",
"type": "Microsoft.ContainerService/managedClusters/agentPools",
"name": "agentpool1",
"properties": {
"provisioningState": "Updating",
"orchestratorVersion": "1.9.6",
"currentOrchestratorVersion": "1.9.6",
"count": 3,
"enableAutoScaling": true,
"minCount": 2,
"maxCount": 2,
"vmSize": "Standard_DS1_v2",
"maxPods": 110,
"osType": "Linux",
"nodeTaints": [
"Key1=Value1:NoSchedule"
],
"scaleSetPriority": "Spot",
"scaleSetEvictionPolicy": "Delete"
}
}
Определения
Имя |
Описание |
AgentPool
|
Пул агентов.
|
AgentPoolMode
|
Режим пула агентов.
|
AgentPoolNetworkProfile
|
Параметры сети пула агентов.
|
AgentPoolType
|
Тип пула агентов.
|
AgentPoolUpgradeSettings
|
Параметры обновления агентаpool
|
AgentPoolWindowsProfile
|
Конкретный профиль пула агентов Windows.
|
CloudError
|
Ответ об ошибке службы контейнеров.
|
CloudErrorBody
|
Ответ об ошибке службы контейнеров.
|
code
|
Указывает, запущен ли кластер или остановлен
|
CreationData
|
Данные, используемые при создании целевого ресурса из исходного ресурса.
|
GPUInstanceProfile
|
GPUInstanceProfile для указания профиля экземпляра GPU MIG для поддерживаемого номера SKU виртуальной машины GPU.
|
IPTag
|
Содержит IPTag, связанный с объектом.
|
KubeletConfig
|
Конфигурации Kubelet узлов агента.
|
KubeletDiskType
|
Определяет размещение томов emptyDir, корневого каталога данных среды выполнения контейнера и эфемерного хранилища Kubelet.
|
LinuxOSConfig
|
Конфигурации ОС узлов агента Linux.
|
OSDiskType
|
Тип диска ОС, используемый для компьютеров в пуле агентов.
|
OSSKU
|
Указывает номер SKU ОС, используемый пулом агентов. По умолчанию используется Ubuntu, если OSType — Linux. По умолчанию используется Windows2019, если Kubernetes <= 1.24 или Windows2022, если Kubernetes >= 1,25, если OSType — Windows.
|
OSType
|
Тип операционной системы. По умолчанию используется Linux.
|
PortRange
|
Диапазон портов.
|
PowerState
|
Описание состояния power для кластера
|
Protocol
|
Сетевой протокол порта.
|
ScaleDownMode
|
Описывает, как виртуальные машины добавляются в пулы агентов или удаляются из них. См. состояния выставления счетов.
|
ScaleSetEvictionPolicy
|
Политика вытеснения масштабируемого набора виртуальных машин.
|
ScaleSetPriority
|
Приоритет масштабируемого набора виртуальных машин.
|
SysctlConfig
|
Параметры sysctl для узлов агента Linux.
|
WorkloadRuntime
|
Определяет тип рабочей нагрузки, который может выполнять узел.
|
AgentPool
Пул агентов.
Имя |
Тип |
Default value |
Описание |
id
|
string
|
|
Идентификатор ресурса.
|
name
|
string
|
|
Имя ресурса, уникального в группе ресурсов. Это имя можно использовать для доступа к ресурсу.
|
properties.availabilityZones
|
string[]
|
|
Список зон доступности, используемых для узлов. Это можно указать, только если свойство AgentPoolType — VirtualMachineScaleSets.
|
properties.capacityReservationGroupID
|
string
|
|
Полный идентификатор ресурса группы резервирования емкости для предоставления виртуальных машин из зарезервированной группы виртуальных машин.
AKS связывает указанный пул агентов с группой резервирования емкости.
|
properties.count
|
integer
|
|
Количество агентов (виртуальных машин) для размещения контейнеров Docker. Допустимые значения должны находиться в диапазоне от 0 до 1000 (включительно) для пулов пользователей и в диапазоне от 1 до 1000 (включительно) для системных пулов. Значение по умолчанию — 1.
|
properties.creationData
|
CreationData
|
|
Создание данных, используемых для указания исходного идентификатора моментального снимка, если пул узлов будет создан или обновлен с помощью моментального снимка.
|
properties.currentOrchestratorVersion
|
string
|
|
Версия Kubernetes, запущенная пулом агентов.
Если orchestratorVersion является полностью указанной версией <major.minor.patch>, это поле будет точно равно ему. Если orchestratorVersion <major.minor>, это поле будет содержать полную версию <major.minor.patch>.
|
properties.enableAutoScaling
|
boolean
|
|
Включение автоматического масштабирования
|
properties.enableEncryptionAtHost
|
boolean
|
|
Следует ли включить шифрование дисков на основе узла и ОС.
Это поддерживается только в определенных размерах виртуальных машин и в определенных регионах Azure. Дополнительные сведения см. в статье https://docs.microsoft.com/azure/aks/enable-host-encryption
|
properties.enableFIPS
|
boolean
|
|
Следует ли использовать ОС с поддержкой FIPS.
Дополнительные сведения см. в статье Добавление пула узлов с поддержкой FIPS.
|
properties.enableNodePublicIP
|
boolean
|
|
Выделяется ли каждый узел собственным общедоступным IP-адресом.
В некоторых сценариях может потребоваться, чтобы узлы в пуле узлов получали собственные выделенные общедоступные IP-адреса. Распространенный сценарий — для игровых рабочих нагрузок, где консоль должна сделать прямое подключение к облачной виртуальной машине, чтобы свести к минимуму прыжки. Дополнительные сведения см. в назначении общедоступного IP-адреса наузла. Значение по умолчанию — false.
|
properties.enableUltraSSD
|
boolean
|
|
Включение UltraSSD
|
properties.gpuInstanceProfile
|
GPUInstanceProfile
|
|
GPUInstanceProfile для указания профиля экземпляра GPU MIG для поддерживаемого номера SKU виртуальной машины GPU.
|
properties.hostGroupID
|
string
|
|
Полный идентификатор ресурса выделенной группы узлов для подготовки виртуальных машин, используемый только в сценарии создания и не допуская изменения после установки.
Это форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. Дополнительные сведения см. в выделенных узлах Azure.
|
properties.kubeletConfig
|
KubeletConfig
|
|
Конфигурации Kubelet узлов агента.
Конфигурация Kubelet на узлах пула агентов.
|
properties.kubeletDiskType
|
KubeletDiskType
|
|
Определяет размещение томов emptyDir, корневого каталога данных среды выполнения контейнера и эфемерного хранилища Kubelet.
|
properties.linuxOSConfig
|
LinuxOSConfig
|
|
Конфигурации ОС узлов агента Linux.
Конфигурация ОС узлов агента Linux.
|
properties.maxCount
|
integer
|
|
Максимальное количество узлов для автоматического масштабирования
|
properties.maxPods
|
integer
|
|
Максимальное количество модулей pod, которые могут выполняться на узле.
|
properties.minCount
|
integer
|
|
Минимальное количество узлов для автоматического масштабирования
|
properties.mode
|
AgentPoolMode
|
|
Режим пула агентов.
Кластер должен иметь по крайней мере один пул агентов System. Дополнительные сведения об ограничениях пула агентов и рекомендациях см. в статье https://docs.microsoft.com/azure/aks/use-system-pools
|
properties.networkProfile
|
AgentPoolNetworkProfile
|
|
Параметры пула агентов, связанные с сетью.
|
properties.nodeImageVersion
|
string
|
|
Версия образа узла
|
properties.nodeLabels
|
object
|
|
Метки узлов, которые необходимо сохранить во всех узлах в пуле агентов.
|
properties.nodePublicIPPrefixID
|
string
|
|
Идентификатор префикса общедоступного IP-адреса, из которого узлы виртуальной машины должны использовать IP-адреса.
Это форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}
|
properties.nodeTaints
|
string[]
|
|
Фрагменты, добавленные к новым узлам во время создания и масштабирования пула узлов. Например, key=value:NoSchedule.
|
properties.orchestratorVersion
|
string
|
|
Версия Kubernetes, указанная пользователем.
Поддерживаются оба исправления <major.minor.patch> (например, 1.20.13) и <основных.дополнительных> (например, 1.20). Если указан <основной.дополнительный>, то последняя поддерживаемая версия исправления общедоступной версии выбирается автоматически. Обновление кластера с тем же <основной.дополнительный> после его создания (например, 1.14.x -> 1.14) не активирует обновление, даже если новая версия исправлений доступна. Рекомендуется обновить все пулы узлов в кластере AKS до той же версии Kubernetes. Версия пула узлов должна иметь ту же основную версию, что и плоскость управления. Дополнительная версия пула узлов должна находиться в двух дополнительных версиях версии уровня управления. Версия пула узлов не может быть больше версии уровня управления. Дополнительные сведения см. в обновлении пула узлов.
|
properties.osDiskSizeGB
|
integer
|
|
Размер диска ОС в ГБ, используемый для указания размера диска для каждого компьютера в пуле главных и агентов. Если указать значение 0, он будет применять размер osDisk по умолчанию в соответствии с указанным vmSize.
|
properties.osDiskType
|
OSDiskType
|
|
Тип диска ОС, используемый для компьютеров в пуле агентов.
Значение по умолчанию — "Ephemeral", если виртуальная машина поддерживает ее и имеет диск кэша больше запрошенного OSDiskSizeGB. В противном случае значение по умолчанию — Managed. Может не быть изменено после создания. Дополнительные сведения см. в эфемерной ОС.
|
properties.osSKU
|
OSSKU
|
|
Указывает номер SKU ОС, используемый пулом агентов. По умолчанию используется Ubuntu, если OSType — Linux. По умолчанию используется Windows2019, если Kubernetes <= 1.24 или Windows2022, если Kubernetes >= 1,25, если OSType — Windows.
|
properties.osType
|
OSType
|
Linux
|
Тип операционной системы. По умолчанию используется Linux.
|
properties.podSubnetID
|
string
|
|
Идентификатор подсети, к которой будут присоединяться модули pod при запуске.
Если не указано, IP-адреса pod статически назначаются в подсети узла (дополнительные сведения см. в статье vnetSubnetID). Эта форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
properties.powerState
|
PowerState
|
|
Выполняется или останавливается ли пул агентов.
При первом создании пула агентов он изначально выполняется. Пул агентов можно остановить, установив для этого поля значение "Остановлено". Остановленный пул агентов останавливает все виртуальные машины и не взимает плата за выставление счетов. Пул агентов может быть остановлен только в том случае, если оно запущено и состояние подготовки выполнено успешно.
|
properties.provisioningState
|
string
|
|
Текущее состояние развертывания или подготовки.
|
properties.proximityPlacementGroupID
|
string
|
|
Идентификатор группы размещения близкого взаимодействия.
|
properties.scaleDownMode
|
ScaleDownMode
|
|
Режим уменьшения масштаба, используемый при масштабировании пула агентов.
Это также влияет на поведение автомасштабирования кластера. Если он не указан, по умолчанию используется значение Delete.
|
properties.scaleSetEvictionPolicy
|
ScaleSetEvictionPolicy
|
Delete
|
Политика вытеснения масштабируемого набора виртуальных машин.
Это нельзя указать, если параметр scaleSetPriority не имеет значения Spot. Если значение не указано, значение по умолчанию — "Удалить".
|
properties.scaleSetPriority
|
ScaleSetPriority
|
Regular
|
Приоритет масштабируемого набора виртуальных машин. Если значение не указано, значение по умолчанию — "Regular".
|
properties.spotMaxPrice
|
number
|
-1
|
Максимальная цена (в долларах США) вы готовы платить за точечные экземпляры. Возможные значения — это любое десятичное значение больше нуля или -1, указывающее, что цена по умолчанию up-to по запросу.
Возможные значения — это любое десятичное значение, больше нуля или -1 которое указывает на готовность платить любую цену по запросу. Дополнительные сведения о ценах на точечные виртуальные машины см. в цен на точечные виртуальные машины
|
properties.tags
|
object
|
|
Теги, которые необходимо сохранить в масштабируемом наборе виртуальных машин пула агентов.
|
properties.type
|
AgentPoolType
|
|
Тип пула агентов.
|
properties.upgradeSettings
|
AgentPoolUpgradeSettings
|
|
Параметры обновления агентаpool
|
properties.vmSize
|
string
|
|
Размер виртуальных машин пула агентов.
Доступность размера виртуальной машины зависит от региона. Если узел содержит недостаточные вычислительные ресурсы (память, ЦП и т. д.), модули pod могут не выполняться правильно. Дополнительные сведения об ограниченных размерах виртуальных машин см. в статье https://docs.microsoft.com/azure/aks/quotas-skus-regions
|
properties.vnetSubnetID
|
string
|
|
Идентификатор подсети, в которой узлы пула агентов и при необходимости модули pod присоединяются при запуске.
Если это не указано, будет создана и используется виртуальная сеть и подсеть. Если параметр podSubnetID не указан, это относится к узлам и модулям pod, в противном случае оно применяется только к узлам. Эта форма: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
|
properties.windowsProfile
|
AgentPoolWindowsProfile
|
|
Конкретный профиль пула агентов Windows.
|
properties.workloadRuntime
|
WorkloadRuntime
|
|
Определяет тип рабочей нагрузки, который может выполнять узел.
|
type
|
string
|
|
Тип ресурса
|
AgentPoolMode
Режим пула агентов.
Имя |
Тип |
Описание |
System
|
string
|
Пулы агентов системы в основном предназначены для размещения критически важных системных модулей pod, таких как CoreDNS и metrics-server. Пулы системных агентов osType должны быть Linux. Номер SKU пулов агентов системы должен содержать не менее 2vCP и 4 ГБ памяти.
|
User
|
string
|
Пулы агентов пользователей в основном предназначены для размещения модулей pod приложения.
|
AgentPoolNetworkProfile
Параметры сети пула агентов.
Имя |
Тип |
Описание |
allowedHostPorts
|
PortRange[]
|
Диапазоны портов, к которым разрешен доступ. Указанные диапазоны могут перекрываться.
|
applicationSecurityGroups
|
string[]
|
Идентификаторы групп безопасности приложений, которые будут связывать пул агентов при создании.
|
nodePublicIPTags
|
IPTag[]
|
IPTags общедоступных IP-адресов уровня экземпляра.
|
AgentPoolType
Тип пула агентов.
Имя |
Тип |
Описание |
AvailabilitySet
|
string
|
Использование этого настоятельно не рекомендуется.
|
VirtualMachineScaleSets
|
string
|
Создайте пул агентов, поддерживаемый масштабируемым набором виртуальных машин.
|
AgentPoolUpgradeSettings
Параметры обновления агентаpool
Имя |
Тип |
Описание |
drainTimeoutInMinutes
|
integer
|
Время ожидания очистки узла
Количество времени (в минутах) для вытеснения модулей pod и корректного завершения на узел. Это вытеснение времени ожидания учитывает ожидание бюджетов нарушений pod. Если это время превышено, обновление завершается ошибкой. Если значение не указано, значение по умолчанию — 30 минут.
|
maxSurge
|
string
|
Максимальное число или процент узлов, которые резко возросли во время обновления.
Для этого можно задать целое число (например, "5") или процент (например, "50%". Если указан процент, это процент общего размера пула агентов во время обновления. В процентах дробные узлы округляются вверх. Если значение не указано, значение по умолчанию равно 1. Дополнительные сведения, включая рекомендации, см. в статье https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade
|
nodeSoakDurationInMinutes
|
integer
|
Длительность замока для узла
Время ожидания (в минутах) после очистки узла и перед повторной подготовкой к нему и переход к следующему узлу. Если значение не указано, значение по умолчанию — 0 минут.
|
AgentPoolWindowsProfile
Конкретный профиль пула агентов Windows.
Имя |
Тип |
Описание |
disableOutboundNat
|
boolean
|
Отключение outboundNAT в узлах Windows
Значение по умолчанию — false. Исходящий NAT можно отключить только в том случае, если исходящий тип кластера является шлюзом NAT, а пул агентов Windows не включает общедоступный IP-адрес узла.
|
CloudError
Ответ об ошибке службы контейнеров.
CloudErrorBody
Ответ об ошибке службы контейнеров.
Имя |
Тип |
Описание |
code
|
string
|
Идентификатор ошибки. Коды являются инвариантными и предназначены для программного использования.
|
details
|
CloudErrorBody[]
|
Список дополнительных сведений об ошибке.
|
message
|
string
|
Сообщение, описывающее ошибку, предназначенное для отображения в пользовательском интерфейсе.
|
target
|
string
|
Целевой объект конкретной ошибки. Например, имя свойства в ошибке.
|
code
Указывает, запущен ли кластер или остановлен
Имя |
Тип |
Описание |
Running
|
string
|
Кластер запущен.
|
Stopped
|
string
|
Кластер остановлен.
|
CreationData
Данные, используемые при создании целевого ресурса из исходного ресурса.
Имя |
Тип |
Описание |
sourceResourceId
|
string
|
Это идентификатор ARM исходного объекта, который будет использоваться для создания целевого объекта.
|
GPUInstanceProfile
GPUInstanceProfile для указания профиля экземпляра GPU MIG для поддерживаемого номера SKU виртуальной машины GPU.
Имя |
Тип |
Описание |
MIG1g
|
string
|
|
MIG2g
|
string
|
|
MIG3g
|
string
|
|
MIG4g
|
string
|
|
MIG7g
|
string
|
|
IPTag
Содержит IPTag, связанный с объектом.
Имя |
Тип |
Описание |
ipTagType
|
string
|
Тип тега IP. Пример: RoutingPreference.
|
tag
|
string
|
Значение тега IP, связанного с общедоступным IP-адресом. Пример: Интернет.
|
KubeletConfig
Конфигурации Kubelet узлов агента.
Имя |
Тип |
Описание |
allowedUnsafeSysctls
|
string[]
|
Разрешен список небезопасных системных шаблонов или небезопасных шаблонов sysctl (заканчивающийся * ).
|
containerLogMaxFiles
|
integer
|
Максимальное количество файлов журнала контейнеров, которые могут присутствовать для контейнера. Число должно быть ≥ 2.
|
containerLogMaxSizeMB
|
integer
|
Максимальный размер (например, 10Mi) файла журнала контейнера перед его поворотом.
|
cpuCfsQuota
|
boolean
|
Если принудительное применение квот ЦП CFS включено для контейнеров, указывающих ограничения ЦП.
Значение по умолчанию — true.
|
cpuCfsQuotaPeriod
|
string
|
Значение квоты ЦП CFS.
Значение по умолчанию — "100 мс". Допустимые значения — это последовательность десятичных чисел с необязательной дроби и суффиксом единицы. Например: "300 мс", "2h45m". Поддерживаемые единицы: "ns", "us", "ms", "s", "m" и "h".
|
cpuManagerPolicy
|
string
|
Политика диспетчера ЦП, используемая.
Значение по умолчанию — none. Дополнительные сведения см. в политиках управления ЦП Kubernetes. Допустимые значения : none и static.
|
failSwapOn
|
boolean
|
Если задано значение true, это приведет к сбою запуска Kubelet, если переключение включено на узле.
|
imageGcHighThreshold
|
integer
|
Процент использования диска, после которого сборка мусора образа всегда выполняется.
Чтобы отключить сборку мусора образа, установите значение 100. Значение по умолчанию — 85%
|
imageGcLowThreshold
|
integer
|
Процент использования диска, перед которым не выполняется сборка мусора образа.
Это не может быть задано выше, чем imageGcHighThreshold. Значение по умолчанию — 80%
|
podMaxPids
|
integer
|
Максимальное количество процессов на модуль pod.
|
topologyManagerPolicy
|
string
|
Политика диспетчера топологий, используемая.
Дополнительные сведения см. в диспетчере топологий Kubernetes. Значение по умолчанию — none. Допустимые значения : none, best-effort, "restricted" и "single-numa-node".
|
KubeletDiskType
Определяет размещение томов emptyDir, корневого каталога данных среды выполнения контейнера и эфемерного хранилища Kubelet.
Имя |
Тип |
Описание |
OS
|
string
|
Kubelet будет использовать диск ОС для своих данных.
|
Temporary
|
string
|
Kubelet будет использовать временный диск для своих данных.
|
LinuxOSConfig
Конфигурации ОС узлов агента Linux.
Имя |
Тип |
Описание |
swapFileSizeMB
|
integer
|
Размер файла буфера в МБ, который будет создан на каждом узле.
|
sysctls
|
SysctlConfig
|
Параметры sysctl для узлов агента Linux.
|
transparentHugePageDefrag
|
string
|
Следует ли ядро использовать агрессивное использование сжатия памяти для повышения доступности огромных страниц.
Допустимые значения: "always", "defer", "defer+madvise", "madvise" и "никогда". Значение по умолчанию — madvise. Дополнительные сведения см. в прозрачных огромных.
|
transparentHugePageEnabled
|
string
|
Включены ли прозрачные огромные страницы.
Допустимые значения: "always", "madvise" и "никогда". Значение по умолчанию — always. Дополнительные сведения см. в прозрачных огромных.
|
OSDiskType
Тип диска ОС, используемый для компьютеров в пуле агентов.
Имя |
Тип |
Описание |
Ephemeral
|
string
|
Временные диски ОС хранятся только на хост-компьютере, как временный диск. Это обеспечивает более низкую задержку чтения и записи, а также более быстрое масштабирование узлов и обновление кластера.
|
Managed
|
string
|
Azure реплицирует диск операционной системы для виртуальной машины в хранилище Azure, чтобы избежать потери данных, если виртуальная машина должна быть перемещена на другой узел. Так как контейнеры не предназначены для сохранения локального состояния, это поведение обеспечивает ограниченное значение, предоставляя некоторые недостатки, включая более низкую подготовку узлов и более высокую задержку чтения и записи.
|
OSSKU
Указывает номер SKU ОС, используемый пулом агентов. По умолчанию используется Ubuntu, если OSType — Linux. По умолчанию используется Windows2019, если Kubernetes <= 1.24 или Windows2022, если Kubernetes >= 1,25, если OSType — Windows.
Имя |
Тип |
Описание |
AzureLinux
|
string
|
Используйте AzureLinux в качестве ОС для образов узлов. Azure Linux — это дистрибутив Linux, оптимизированный для контейнеров, созданный корпорацией Майкрософт, и дополнительные сведения см. в https://aka.ms/azurelinux.
|
CBLMariner
|
string
|
Устаревший OSSKU. Корпорация Майкрософт рекомендует вместо этого выбрать azureLinux для новых развертываний.
|
Ubuntu
|
string
|
Используйте Ubuntu в качестве ОС для образов узлов.
|
Windows2019
|
string
|
Используйте Windows2019 в качестве ОС для образов узлов. Неподдерживаемый для пулов системных узлов. Windows2019 поддерживает только контейнеры Windows2019; Он не может запускать контейнеры Windows2022 и наоборот.
|
Windows2022
|
string
|
Используйте Windows2022 в качестве ОС для образов узлов. Неподдерживаемый для пулов системных узлов. Windows2022 поддерживает только контейнеры Windows2022; Он не может запускать контейнеры Windows2019 и наоборот.
|
OSType
Тип операционной системы. По умолчанию используется Linux.
Имя |
Тип |
Описание |
Linux
|
string
|
Используйте Linux.
|
Windows
|
string
|
Используйте Windows.
|
PortRange
Диапазон портов.
Имя |
Тип |
Описание |
portEnd
|
integer
|
Максимальный порт, включенный в диапазон. Он должен иметь диапазон от 1 до 65535, а также быть больше или равен портуStart.
|
portStart
|
integer
|
Минимальный порт, включенный в диапазон. Он должен быть равен от 1 до 65535, а также должен быть меньше или равен portEnd.
|
protocol
|
Protocol
|
Сетевой протокол порта.
|
PowerState
Описание состояния power для кластера
Имя |
Тип |
Описание |
code
|
code
|
Указывает, запущен ли кластер или остановлен
|
Protocol
Сетевой протокол порта.
Имя |
Тип |
Описание |
TCP
|
string
|
ПРОТОКОЛ TCP.
|
UDP
|
string
|
Протокол UDP.
|
ScaleDownMode
Описывает, как виртуальные машины добавляются в пулы агентов или удаляются из них. См. состояния выставления счетов.
Имя |
Тип |
Описание |
Deallocate
|
string
|
Попытайтесь запустить освобожденные экземпляры (если они существуют) во время увеличения масштаба и освобождения экземпляров во время уменьшения масштаба.
|
Delete
|
string
|
Создайте новые экземпляры во время увеличения масштаба и удаления экземпляров во время уменьшения масштаба.
|
ScaleSetEvictionPolicy
Политика вытеснения масштабируемого набора виртуальных машин.
Имя |
Тип |
Описание |
Deallocate
|
string
|
Узлы в базовом масштабируемом наборе пула узлов задаются в состоянии остановленного размещения после вытеснения. Узлы в счетчике остановленного состояния в квоте вычислений и могут вызвать проблемы с масштабированием кластера или обновлением.
|
Delete
|
string
|
Узлы в базовом масштабируемом наборе пула узлов удаляются при их вытеснения.
|
ScaleSetPriority
Приоритет масштабируемого набора виртуальных машин.
Имя |
Тип |
Описание |
Regular
|
string
|
Будут использоваться обычные виртуальные машины.
|
Spot
|
string
|
Будут использоваться виртуальные машины с приоритетом. Соглашение об уровне обслуживания для точечных узлов отсутствует. Дополнительные сведения см. в месте AKS.
|
SysctlConfig
Параметры sysctl для узлов агента Linux.
Имя |
Тип |
Описание |
fsAioMaxNr
|
integer
|
Sysctl setting fs.aio-max-nr.
|
fsFileMax
|
integer
|
Sysctl setting fs.file-max.
|
fsInotifyMaxUserWatches
|
integer
|
Параметр sysctl fs.inotify.max_user_watches.
|
fsNrOpen
|
integer
|
Параметр sysctl fs.nr_open.
|
kernelThreadsMax
|
integer
|
Sysctl setting kernel.threads-max.
|
netCoreNetdevMaxBacklog
|
integer
|
Параметр sysctl net.core.netdev_max_backlog.
|
netCoreOptmemMax
|
integer
|
Параметр sysctl net.core.optmem_max.
|
netCoreRmemDefault
|
integer
|
Параметр sysctl net.core.rmem_default.
|
netCoreRmemMax
|
integer
|
Параметр sysctl net.core.rmem_max.
|
netCoreSomaxconn
|
integer
|
Sysctl setting net.core.somaxconn.
|
netCoreWmemDefault
|
integer
|
Параметр sysctl net.core.wmem_default.
|
netCoreWmemMax
|
integer
|
Параметр sysctl net.core.wmem_max.
|
netIpv4IpLocalPortRange
|
string
|
Параметр sysctl net.ipv4.ip_local_port_range.
|
netIpv4NeighDefaultGcThresh1
|
integer
|
Параметр sysctl net.ipv4.neigh.default.gc_thresh1.
|
netIpv4NeighDefaultGcThresh2
|
integer
|
Параметр sysctl net.ipv4.neigh.default.gc_thresh2.
|
netIpv4NeighDefaultGcThresh3
|
integer
|
Параметр sysctl net.ipv4.neigh.default.gc_thresh3.
|
netIpv4TcpFinTimeout
|
integer
|
Параметр sysctl net.ipv4.tcp_fin_timeout.
|
netIpv4TcpKeepaliveProbes
|
integer
|
Параметр sysctl net.ipv4.tcp_keepalive_probes.
|
netIpv4TcpKeepaliveTime
|
integer
|
Параметр sysctl net.ipv4.tcp_keepalive_time.
|
netIpv4TcpMaxSynBacklog
|
integer
|
Параметр sysctl net.ipv4.tcp_max_syn_backlog.
|
netIpv4TcpMaxTwBuckets
|
integer
|
Параметр sysctl net.ipv4.tcp_max_tw_buckets.
|
netIpv4TcpTwReuse
|
boolean
|
Параметр sysctl net.ipv4.tcp_tw_reuse.
|
netIpv4TcpkeepaliveIntvl
|
integer
|
Параметр sysctl net.ipv4.tcp_keepalive_intvl.
|
netNetfilterNfConntrackBuckets
|
integer
|
Параметр sysctl net.netfilter.nf_conntrack_buckets.
|
netNetfilterNfConntrackMax
|
integer
|
Параметр sysctl net.netfilter.nf_conntrack_max.
|
vmMaxMapCount
|
integer
|
Параметр sysctl vm.max_map_count.
|
vmSwappiness
|
integer
|
Параметр sysctl vm.swappiness.
|
vmVfsCachePressure
|
integer
|
Параметр sysctl vm.vfs_cache_pressure.
|
WorkloadRuntime
Определяет тип рабочей нагрузки, который может выполнять узел.
Имя |
Тип |
Описание |
OCIContainer
|
string
|
Узлы будут использовать Kubelet для выполнения стандартных рабочих нагрузок контейнеров OCI.
|
WasmWasi
|
string
|
Узлы будут использовать Krustlet для запуска рабочих нагрузок WASM с помощью поставщика WASI (предварительная версия).
|