AgentPool

class AgentPool : KotlinCustomResource

Uses Azure REST API version 2025-02-01. In version 2.x of the Azure Native provider, it used API version 2023-10-01-preview. Other available API versions: 2023-10-01-preview, 2024-06-01-preview, 2024-07-01, 2024-10-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native networkcloud [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update Kubernetes cluster agent pool

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var agentPool = new AzureNative.NetworkCloud.AgentPool("agentPool", new()
{
AdministratorConfiguration = new AzureNative.NetworkCloud.Inputs.AdministratorConfigurationArgs
{
AdminUsername = "azure",
SshPublicKeys = new[]
{
new AzureNative.NetworkCloud.Inputs.SshPublicKeyArgs
{
KeyData = "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm",
},
},
},
AgentOptions = new AzureNative.NetworkCloud.Inputs.AgentOptionsArgs
{
HugepagesCount = 96,
HugepagesSize = AzureNative.NetworkCloud.HugepagesSize.HugepagesSize_1G,
},
AgentPoolName = "agentPoolName",
AttachedNetworkConfiguration = new AzureNative.NetworkCloud.Inputs.AttachedNetworkConfigurationArgs
{
L2Networks = new[]
{
new AzureNative.NetworkCloud.Inputs.L2NetworkAttachmentConfigurationArgs
{
NetworkId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName",
PluginType = AzureNative.NetworkCloud.KubernetesPluginType.DPDK,
},
},
L3Networks = new[]
{
new AzureNative.NetworkCloud.Inputs.L3NetworkAttachmentConfigurationArgs
{
IpamEnabled = AzureNative.NetworkCloud.L3NetworkConfigurationIpamEnabled.False,
NetworkId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName",
PluginType = AzureNative.NetworkCloud.KubernetesPluginType.SRIOV,
},
},
TrunkedNetworks = new[]
{
new AzureNative.NetworkCloud.Inputs.TrunkedNetworkAttachmentConfigurationArgs
{
NetworkId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName",
PluginType = AzureNative.NetworkCloud.KubernetesPluginType.MACVLAN,
},
},
},
AvailabilityZones = new[]
{
"1",
"2",
"3",
},
Count = 3,
ExtendedLocation = new AzureNative.NetworkCloud.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName",
Type = "CustomLocation",
},
KubernetesClusterName = "kubernetesClusterName",
Labels = new[]
{
new AzureNative.NetworkCloud.Inputs.KubernetesLabelArgs
{
Key = "kubernetes.label",
Value = "true",
},
},
Location = "location",
Mode = AzureNative.NetworkCloud.AgentPoolMode.System,
ResourceGroupName = "resourceGroupName",
Tags =
{
{ "key1", "myvalue1" },
{ "key2", "myvalue2" },
},
Taints = new[]
{
new AzureNative.NetworkCloud.Inputs.KubernetesLabelArgs
{
Key = "kubernetes.taint",
Value = "true:NoSchedule",
},
},
UpgradeSettings = new AzureNative.NetworkCloud.Inputs.AgentPoolUpgradeSettingsArgs
{
MaxSurge = "1",
},
VmSkuName = "NC_P46_224_v1",
});
});
package main
import (
networkcloud "github.com/pulumi/pulumi-azure-native-sdk/networkcloud/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networkcloud.NewAgentPool(ctx, "agentPool", &networkcloud.AgentPoolArgs{
AdministratorConfiguration: &networkcloud.AdministratorConfigurationArgs{
AdminUsername: pulumi.String("azure"),
SshPublicKeys: networkcloud.SshPublicKeyArray{
&networkcloud.SshPublicKeyArgs{
KeyData: pulumi.String("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"),
},
},
},
AgentOptions: &networkcloud.AgentOptionsArgs{
HugepagesCount: pulumi.Float64(96),
HugepagesSize: pulumi.String(networkcloud.HugepagesSize_1G),
},
AgentPoolName: pulumi.String("agentPoolName"),
AttachedNetworkConfiguration: &networkcloud.AttachedNetworkConfigurationArgs{
L2Networks: networkcloud.L2NetworkAttachmentConfigurationArray{
&networkcloud.L2NetworkAttachmentConfigurationArgs{
NetworkId: pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"),
PluginType: pulumi.String(networkcloud.KubernetesPluginTypeDPDK),
},
},
L3Networks: networkcloud.L3NetworkAttachmentConfigurationArray{
&networkcloud.L3NetworkAttachmentConfigurationArgs{
IpamEnabled: pulumi.String(networkcloud.L3NetworkConfigurationIpamEnabledFalse),
NetworkId: pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"),
PluginType: pulumi.String(networkcloud.KubernetesPluginTypeSRIOV),
},
},
TrunkedNetworks: networkcloud.TrunkedNetworkAttachmentConfigurationArray{
&networkcloud.TrunkedNetworkAttachmentConfigurationArgs{
NetworkId: pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"),
PluginType: pulumi.String(networkcloud.KubernetesPluginTypeMACVLAN),
},
},
},
AvailabilityZones: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("3"),
},
Count: pulumi.Float64(3),
ExtendedLocation: &networkcloud.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"),
Type: pulumi.String("CustomLocation"),
},
KubernetesClusterName: pulumi.String("kubernetesClusterName"),
Labels: networkcloud.KubernetesLabelArray{
&networkcloud.KubernetesLabelArgs{
Key: pulumi.String("kubernetes.label"),
Value: pulumi.String("true"),
},
},
Location: pulumi.String("location"),
Mode: pulumi.String(networkcloud.AgentPoolModeSystem),
ResourceGroupName: pulumi.String("resourceGroupName"),
Tags: pulumi.StringMap{
"key1": pulumi.String("myvalue1"),
"key2": pulumi.String("myvalue2"),
},
Taints: networkcloud.KubernetesLabelArray{
&networkcloud.KubernetesLabelArgs{
Key: pulumi.String("kubernetes.taint"),
Value: pulumi.String("true:NoSchedule"),
},
},
UpgradeSettings: &networkcloud.AgentPoolUpgradeSettingsArgs{
MaxSurge: pulumi.String("1"),
},
VmSkuName: pulumi.String("NC_P46_224_v1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.networkcloud.AgentPool;
import com.pulumi.azurenative.networkcloud.AgentPoolArgs;
import com.pulumi.azurenative.networkcloud.inputs.AdministratorConfigurationArgs;
import com.pulumi.azurenative.networkcloud.inputs.AgentOptionsArgs;
import com.pulumi.azurenative.networkcloud.inputs.AttachedNetworkConfigurationArgs;
import com.pulumi.azurenative.networkcloud.inputs.ExtendedLocationArgs;
import com.pulumi.azurenative.networkcloud.inputs.KubernetesLabelArgs;
import com.pulumi.azurenative.networkcloud.inputs.AgentPoolUpgradeSettingsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var agentPool = new AgentPool("agentPool", AgentPoolArgs.builder()
.administratorConfiguration(AdministratorConfigurationArgs.builder()
.adminUsername("azure")
.sshPublicKeys(SshPublicKeyArgs.builder()
.keyData("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm")
.build())
.build())
.agentOptions(AgentOptionsArgs.builder()
.hugepagesCount(96)
.hugepagesSize("1G")
.build())
.agentPoolName("agentPoolName")
.attachedNetworkConfiguration(AttachedNetworkConfigurationArgs.builder()
.l2Networks(L2NetworkAttachmentConfigurationArgs.builder()
.networkId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")
.pluginType("DPDK")
.build())
.l3Networks(L3NetworkAttachmentConfigurationArgs.builder()
.ipamEnabled("False")
.networkId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")
.pluginType("SRIOV")
.build())
.trunkedNetworks(TrunkedNetworkAttachmentConfigurationArgs.builder()
.networkId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")
.pluginType("MACVLAN")
.build())
.build())
.availabilityZones(
"1",
"2",
"3")
.count(3)
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName")
.type("CustomLocation")
.build())
.kubernetesClusterName("kubernetesClusterName")
.labels(KubernetesLabelArgs.builder()
.key("kubernetes.label")
.value("true")
.build())
.location("location")
.mode("System")
.resourceGroupName("resourceGroupName")
.tags(Map.ofEntries(
Map.entry("key1", "myvalue1"),
Map.entry("key2", "myvalue2")
))
.taints(KubernetesLabelArgs.builder()
.key("kubernetes.taint")
.value("true:NoSchedule")
.build())
.upgradeSettings(AgentPoolUpgradeSettingsArgs.builder()
.maxSurge("1")
.build())
.vmSkuName("NC_P46_224_v1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:networkcloud:AgentPool default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}

Properties

Link copied to clipboard

The administrator credentials to be used for the nodes in this agent pool.

Link copied to clipboard

The configurations that will be applied to each agent in this agent pool.

Link copied to clipboard

The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster.

Link copied to clipboard

The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val count: Output<Double>

The number of virtual machines that use this configuration.

Link copied to clipboard
val detailedStatus: Output<String>

The current status of the agent pool.

Link copied to clipboard

The descriptive message about the current detailed status.

Link copied to clipboard
val etag: Output<String>

Resource ETag.

Link copied to clipboard

The extended location of the cluster associated with the resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The Kubernetes version running in this agent pool.

Link copied to clipboard

The labels applied to the nodes in this agent pool.

Link copied to clipboard
val location: Output<String>

The geo-location where the resource lives

Link copied to clipboard
val mode: Output<String>

The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

The provisioning state of the agent pool.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard

The taints applied to the nodes in this agent pool.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard

The configuration of the agent pool.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vmSkuName: Output<String>

The name of the VM SKU that determines the size of resources allocated for node VMs.