KubernetesClusterArgs

data class KubernetesClusterArgs(val aciConnectorLinux: Output<KubernetesClusterAciConnectorLinuxArgs>? = null, val apiServerAccessProfile: Output<KubernetesClusterApiServerAccessProfileArgs>? = null, val autoScalerProfile: Output<KubernetesClusterAutoScalerProfileArgs>? = null, val automaticUpgradeChannel: Output<String>? = null, val azureActiveDirectoryRoleBasedAccessControl: Output<KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlArgs>? = null, val azurePolicyEnabled: Output<Boolean>? = null, val confidentialComputing: Output<KubernetesClusterConfidentialComputingArgs>? = null, val costAnalysisEnabled: Output<Boolean>? = null, val defaultNodePool: Output<KubernetesClusterDefaultNodePoolArgs>? = null, val diskEncryptionSetId: Output<String>? = null, val dnsPrefix: Output<String>? = null, val dnsPrefixPrivateCluster: Output<String>? = null, val edgeZone: Output<String>? = null, val httpApplicationRoutingEnabled: Output<Boolean>? = null, val httpProxyConfig: Output<KubernetesClusterHttpProxyConfigArgs>? = null, val identity: Output<KubernetesClusterIdentityArgs>? = null, val imageCleanerEnabled: Output<Boolean>? = null, val imageCleanerIntervalHours: Output<Int>? = null, val ingressApplicationGateway: Output<KubernetesClusterIngressApplicationGatewayArgs>? = null, val keyManagementService: Output<KubernetesClusterKeyManagementServiceArgs>? = null, val keyVaultSecretsProvider: Output<KubernetesClusterKeyVaultSecretsProviderArgs>? = null, val kubeletIdentity: Output<KubernetesClusterKubeletIdentityArgs>? = null, val kubernetesVersion: Output<String>? = null, val linuxProfile: Output<KubernetesClusterLinuxProfileArgs>? = null, val localAccountDisabled: Output<Boolean>? = null, val location: Output<String>? = null, val maintenanceWindow: Output<KubernetesClusterMaintenanceWindowArgs>? = null, val maintenanceWindowAutoUpgrade: Output<KubernetesClusterMaintenanceWindowAutoUpgradeArgs>? = null, val maintenanceWindowNodeOs: Output<KubernetesClusterMaintenanceWindowNodeOsArgs>? = null, val microsoftDefender: Output<KubernetesClusterMicrosoftDefenderArgs>? = null, val monitorMetrics: Output<KubernetesClusterMonitorMetricsArgs>? = null, val name: Output<String>? = null, val networkProfile: Output<KubernetesClusterNetworkProfileArgs>? = null, val nodeOsUpgradeChannel: Output<String>? = null, val nodeResourceGroup: Output<String>? = null, val oidcIssuerEnabled: Output<Boolean>? = null, val omsAgent: Output<KubernetesClusterOmsAgentArgs>? = null, val openServiceMeshEnabled: Output<Boolean>? = null, val privateClusterEnabled: Output<Boolean>? = null, val privateClusterPublicFqdnEnabled: Output<Boolean>? = null, val privateDnsZoneId: Output<String>? = null, val resourceGroupName: Output<String>? = null, val roleBasedAccessControlEnabled: Output<Boolean>? = null, val runCommandEnabled: Output<Boolean>? = null, val serviceMeshProfile: Output<KubernetesClusterServiceMeshProfileArgs>? = null, val servicePrincipal: Output<KubernetesClusterServicePrincipalArgs>? = null, val skuTier: Output<String>? = null, val storageProfile: Output<KubernetesClusterStorageProfileArgs>? = null, val supportPlan: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val upgradeOverride: Output<KubernetesClusterUpgradeOverrideArgs>? = null, val webAppRouting: Output<KubernetesClusterWebAppRoutingArgs>? = null, val windowsProfile: Output<KubernetesClusterWindowsProfileArgs>? = null, val workloadAutoscalerProfile: Output<KubernetesClusterWorkloadAutoscalerProfileArgs>? = null, val workloadIdentityEnabled: Output<Boolean>? = null) : ConvertibleToJava<KubernetesClusterArgs>

Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service)

Note: Due to the fast-moving nature of AKS, we recommend using the latest version of the Azure Provider when using AKS.

Example Usage

This example provisions a basic Managed Kubernetes Cluster.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
name: "example-aks1",
location: example.location,
resourceGroupName: example.name,
dnsPrefix: "exampleaks1",
defaultNodePool: {
name: "default",
nodeCount: 1,
vmSize: "Standard_D2_v2",
},
identity: {
type: "SystemAssigned",
},
tags: {
Environment: "Production",
},
});
export const clientCertificate = exampleKubernetesCluster.kubeConfigs.apply(kubeConfigs => kubeConfigs[0].clientCertificate);
export const kubeConfig = exampleKubernetesCluster.kubeConfigRaw;
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_kubernetes_cluster = azure.containerservice.KubernetesCluster("example",
name="example-aks1",
location=example.location,
resource_group_name=example.name,
dns_prefix="exampleaks1",
default_node_pool={
"name": "default",
"node_count": 1,
"vm_size": "Standard_D2_v2",
},
identity={
"type": "SystemAssigned",
},
tags={
"Environment": "Production",
})
pulumi.export("clientCertificate", example_kubernetes_cluster.kube_configs[0].client_certificate)
pulumi.export("kubeConfig", example_kubernetes_cluster.kube_config_raw)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("example", new()
{
Name = "example-aks1",
Location = example.Location,
ResourceGroupName = example.Name,
DnsPrefix = "exampleaks1",
DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
{
Name = "default",
NodeCount = 1,
VmSize = "Standard_D2_v2",
},
Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs
{
Type = "SystemAssigned",
},
Tags =
{
{ "Environment", "Production" },
},
});
return new Dictionary<string, object?>
{
["clientCertificate"] = exampleKubernetesCluster&#46;KubeConfigs&#46;Apply(kubeConfigs => kubeConfigs[0].ClientCertificate),
["kubeConfig"] = exampleKubernetesCluster.KubeConfigRaw,
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerservice"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
Name: pulumi.String("example-aks1"),
Location: example.Location,
ResourceGroupName: example.Name,
DnsPrefix: pulumi.String("exampleaks1"),
DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
Name: pulumi.String("default"),
NodeCount: pulumi.Int(1),
VmSize: pulumi.String("Standard_D2_v2"),
},
Identity: &containerservice.KubernetesClusterIdentityArgs{
Type: pulumi.String("SystemAssigned"),
},
Tags: pulumi.StringMap{
"Environment": pulumi.String("Production"),
},
})
if err != nil {
return err
}
ctx.Export("clientCertificate", exampleKubernetesCluster.KubeConfigs.ApplyT(func(kubeConfigs []containerservice.KubernetesClusterKubeConfig) (*string, error) {
return &kubeConfigs[0].ClientCertificate, nil
}).(pulumi.StringPtrOutput))
ctx.Export("kubeConfig", exampleKubernetesCluster.KubeConfigRaw)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.containerservice.KubernetesCluster;
import com.pulumi.azure.containerservice.KubernetesClusterArgs;
import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
import com.pulumi.azure.containerservice.inputs.KubernetesClusterIdentityArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleKubernetesCluster = new KubernetesCluster("exampleKubernetesCluster", KubernetesClusterArgs.builder()
.name("example-aks1")
.location(example.location())
.resourceGroupName(example.name())
.dnsPrefix("exampleaks1")
.defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
.name("default")
.nodeCount(1)
.vmSize("Standard_D2_v2")
.build())
.identity(KubernetesClusterIdentityArgs.builder()
.type("SystemAssigned")
.build())
.tags(Map.of("Environment", "Production"))
.build());
ctx.export("clientCertificate", exampleKubernetesCluster.kubeConfigs().applyValue(_kubeConfigs -> _kubeConfigs[0].clientCertificate()));
ctx.export("kubeConfig", exampleKubernetesCluster.kubeConfigRaw());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleKubernetesCluster:
type: azure:containerservice:KubernetesCluster
name: example
properties:
name: example-aks1
location: ${example.location}
resourceGroupName: ${example.name}
dnsPrefix: exampleaks1
defaultNodePool:
name: default
nodeCount: 1
vmSize: Standard_D2_v2
identity:
type: SystemAssigned
tags:
Environment: Production
outputs:
clientCertificate: ${exampleKubernetesCluster.kubeConfigs[0].clientCertificate}
kubeConfig: ${exampleKubernetesCluster.kubeConfigRaw}

Import

Managed Kubernetes Clusters can be imported using the resource id, e.g.

$ pulumi import azure:containerservice/kubernetesCluster:KubernetesCluster cluster1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ContainerService/managedClusters/cluster1

Constructors

Link copied to clipboard
constructor(aciConnectorLinux: Output<KubernetesClusterAciConnectorLinuxArgs>? = null, apiServerAccessProfile: Output<KubernetesClusterApiServerAccessProfileArgs>? = null, autoScalerProfile: Output<KubernetesClusterAutoScalerProfileArgs>? = null, automaticUpgradeChannel: Output<String>? = null, azureActiveDirectoryRoleBasedAccessControl: Output<KubernetesClusterAzureActiveDirectoryRoleBasedAccessControlArgs>? = null, azurePolicyEnabled: Output<Boolean>? = null, confidentialComputing: Output<KubernetesClusterConfidentialComputingArgs>? = null, costAnalysisEnabled: Output<Boolean>? = null, defaultNodePool: Output<KubernetesClusterDefaultNodePoolArgs>? = null, diskEncryptionSetId: Output<String>? = null, dnsPrefix: Output<String>? = null, dnsPrefixPrivateCluster: Output<String>? = null, edgeZone: Output<String>? = null, httpApplicationRoutingEnabled: Output<Boolean>? = null, httpProxyConfig: Output<KubernetesClusterHttpProxyConfigArgs>? = null, identity: Output<KubernetesClusterIdentityArgs>? = null, imageCleanerEnabled: Output<Boolean>? = null, imageCleanerIntervalHours: Output<Int>? = null, ingressApplicationGateway: Output<KubernetesClusterIngressApplicationGatewayArgs>? = null, keyManagementService: Output<KubernetesClusterKeyManagementServiceArgs>? = null, keyVaultSecretsProvider: Output<KubernetesClusterKeyVaultSecretsProviderArgs>? = null, kubeletIdentity: Output<KubernetesClusterKubeletIdentityArgs>? = null, kubernetesVersion: Output<String>? = null, linuxProfile: Output<KubernetesClusterLinuxProfileArgs>? = null, localAccountDisabled: Output<Boolean>? = null, location: Output<String>? = null, maintenanceWindow: Output<KubernetesClusterMaintenanceWindowArgs>? = null, maintenanceWindowAutoUpgrade: Output<KubernetesClusterMaintenanceWindowAutoUpgradeArgs>? = null, maintenanceWindowNodeOs: Output<KubernetesClusterMaintenanceWindowNodeOsArgs>? = null, microsoftDefender: Output<KubernetesClusterMicrosoftDefenderArgs>? = null, monitorMetrics: Output<KubernetesClusterMonitorMetricsArgs>? = null, name: Output<String>? = null, networkProfile: Output<KubernetesClusterNetworkProfileArgs>? = null, nodeOsUpgradeChannel: Output<String>? = null, nodeResourceGroup: Output<String>? = null, oidcIssuerEnabled: Output<Boolean>? = null, omsAgent: Output<KubernetesClusterOmsAgentArgs>? = null, openServiceMeshEnabled: Output<Boolean>? = null, privateClusterEnabled: Output<Boolean>? = null, privateClusterPublicFqdnEnabled: Output<Boolean>? = null, privateDnsZoneId: Output<String>? = null, resourceGroupName: Output<String>? = null, roleBasedAccessControlEnabled: Output<Boolean>? = null, runCommandEnabled: Output<Boolean>? = null, serviceMeshProfile: Output<KubernetesClusterServiceMeshProfileArgs>? = null, servicePrincipal: Output<KubernetesClusterServicePrincipalArgs>? = null, skuTier: Output<String>? = null, storageProfile: Output<KubernetesClusterStorageProfileArgs>? = null, supportPlan: Output<String>? = null, tags: Output<Map<String, String>>? = null, upgradeOverride: Output<KubernetesClusterUpgradeOverrideArgs>? = null, webAppRouting: Output<KubernetesClusterWebAppRoutingArgs>? = null, windowsProfile: Output<KubernetesClusterWindowsProfileArgs>? = null, workloadAutoscalerProfile: Output<KubernetesClusterWorkloadAutoscalerProfileArgs>? = null, workloadIdentityEnabled: Output<Boolean>? = null)

Properties

Link copied to clipboard

A aci_connector_linux block as defined below. For more details, please visit Create and configure an AKS cluster to use virtual nodes.

Link copied to clipboard

An api_server_access_profile block as defined below.

Link copied to clipboard
val automaticUpgradeChannel: Output<String>? = null

The upgrade channel for this Kubernetes Cluster. Possible values are patch, rapid, node-image and stable. Omitting this field sets this value to none. !>Note: Cluster Auto-Upgrade will update the Kubernetes Cluster (and its Node Pools) to the latest GA version of Kubernetes automatically - please see the Azure documentation for more information.

Link copied to clipboard

A auto_scaler_profile block as defined below.

A azure_active_directory_role_based_access_control block as defined below.

Link copied to clipboard
val azurePolicyEnabled: Output<Boolean>? = null

Should the Azure Policy Add-On be enabled? For more details please visit Understand Azure Policy for Azure Kubernetes Service

Link copied to clipboard

A confidential_computing block as defined below. For more details please the documentation

Link copied to clipboard
val costAnalysisEnabled: Output<Boolean>? = null

Should cost analysis be enabled for this Kubernetes Cluster? Defaults to false. The sku_tier must be set to Standard or Premium to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal.

Link copied to clipboard

Specifies configuration for "System" mode node pool. A default_node_pool block as defined below.

Link copied to clipboard
val diskEncryptionSetId: Output<String>? = null

The ID of the Disk Encryption Set which should be used for the Nodes and Volumes. More information can be found in the documentation. Changing this forces a new resource to be created.

Link copied to clipboard
val dnsPrefix: Output<String>? = null

DNS prefix specified when creating the managed cluster. Possible values must begin and end with a letter or number, contain only letters, numbers, and hyphens and be between 1 and 54 characters in length. Changing this forces a new resource to be created.

Link copied to clipboard
val dnsPrefixPrivateCluster: Output<String>? = null

Specifies the DNS prefix to use with private clusters. Changing this forces a new resource to be created.

Link copied to clipboard
val edgeZone: Output<String>? = null

Specifies the Extended Zone (formerly called Edge Zone) within the Azure Region where this Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.

Link copied to clipboard

Should HTTP Application Routing be enabled?

Link copied to clipboard

A http_proxy_config block as defined below.

Link copied to clipboard

An identity block as defined below. One of either identity or service_principal must be specified. !>Note: A migration scenario from service_principal to identity is supported. When upgrading service_principal to identity, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured service_principal until you upgrade your Node Pool.

Link copied to clipboard
val imageCleanerEnabled: Output<Boolean>? = null

Specifies whether Image Cleaner is enabled.

Link copied to clipboard
val imageCleanerIntervalHours: Output<Int>? = null

Specifies the interval in hours when images should be cleaned up. Defaults to 0.

Link copied to clipboard

A ingress_application_gateway block as defined below.

Link copied to clipboard

A key_management_service block as defined below. For more details, please visit Key Management Service (KMS) etcd encryption to an AKS cluster.

Link copied to clipboard

A key_vault_secrets_provider block as defined below. For more details, please visit Azure Keyvault Secrets Provider for AKS.

Link copied to clipboard

A kubelet_identity block as defined below.

Link copied to clipboard
val kubernetesVersion: Output<String>? = null

Version of Kubernetes specified when creating the AKS managed cluster. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade). AKS does not require an exact patch version to be specified, minor version aliases such as 1.22 are also supported. - The minor version's latest GA patch is automatically chosen in that case. More details can be found in the documentation.

Link copied to clipboard

A linux_profile block as defined below.

Link copied to clipboard
val localAccountDisabled: Output<Boolean>? = null

If true local accounts will be disabled. See the documentation for more information.

Link copied to clipboard
val location: Output<String>? = null

The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.

Link copied to clipboard

A maintenance_window block as defined below.

Link copied to clipboard

A maintenance_window_auto_upgrade block as defined below.

Link copied to clipboard

A maintenance_window_node_os block as defined below.

Link copied to clipboard

A microsoft_defender block as defined below.

Link copied to clipboard

Specifies a Prometheus add-on profile for the Kubernetes Cluster. A monitor_metrics block as defined below.

Link copied to clipboard
val name: Output<String>? = null

The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.

Link copied to clipboard

A network_profile block as defined below. Changing this forces a new resource to be created.

Link copied to clipboard
val nodeOsUpgradeChannel: Output<String>? = null

The upgrade channel for this Kubernetes Cluster Nodes' OS Image. Possible values are Unmanaged, SecurityPatch, NodeImage and None. Defaults to NodeImage.

Link copied to clipboard
val nodeResourceGroup: Output<String>? = null

The name of the Resource Group where the Kubernetes Nodes should exist. Changing this forces a new resource to be created.

Link copied to clipboard
val oidcIssuerEnabled: Output<Boolean>? = null

Enable or Disable the OIDC issuer URL

Link copied to clipboard

A oms_agent block as defined below.

Link copied to clipboard
val openServiceMeshEnabled: Output<Boolean>? = null

Is Open Service Mesh enabled? For more details, please visit Open Service Mesh for AKS.

Link copied to clipboard
val privateClusterEnabled: Output<Boolean>? = null

Should this Kubernetes Cluster have its API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to false. Changing this forces a new resource to be created.

Link copied to clipboard

Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to false.

Link copied to clipboard
val privateDnsZoneId: Output<String>? = null

Either the ID of Private DNS Zone which should be delegated to this Cluster, System to have AKS manage this or None. In case of None you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.

Link copied to clipboard

Whether Role Based Access Control for the Kubernetes Cluster should be enabled. Defaults to true. Changing this forces a new resource to be created.

Link copied to clipboard
val runCommandEnabled: Output<Boolean>? = null

Whether to enable run command for the cluster or not. Defaults to true.

Link copied to clipboard

A service_mesh_profile block as defined below.

Link copied to clipboard

A service_principal block as documented below. One of either identity or service_principal must be specified. !>Note: A migration scenario from service_principal to identity is supported. When upgrading service_principal to identity, your cluster's control plane and addon pods will switch to use managed identity, but the kubelets will keep using your configured service_principal until you upgrade your Node Pool.

Link copied to clipboard
val skuTier: Output<String>? = null

The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free, Standard (which includes the Uptime SLA) and Premium. Defaults to Free.

Link copied to clipboard

A storage_profile block as defined below.

Link copied to clipboard
val supportPlan: Output<String>? = null

Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are KubernetesOfficial and AKSLongTermSupport. Defaults to KubernetesOfficial.

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

A mapping of tags to assign to the resource.

Link copied to clipboard

A upgrade_override block as defined below.

Link copied to clipboard

A web_app_routing block as defined below.

Link copied to clipboard

A windows_profile block as defined below.

Link copied to clipboard

A workload_autoscaler_profile block defined below.

Link copied to clipboard
val workloadIdentityEnabled: Output<Boolean>? = null

Specifies whether Azure AD Workload Identity should be enabled for the Cluster. Defaults to false.

Functions

Link copied to clipboard
open override fun toJava(): KubernetesClusterArgs