AKS Private Cluster
Prerequisite
Resource group name
AKS Cluster name
Application gateway name
VM Size (Standard_D4v3, Standard_B2s, etc...)
AKS Subnet Id
Application Gateway subnet id
Get Subnet Ids
az network vnet subnet list --resource-group EX-TEST --vnet-name ex-test-ag-vnetInstall AKS Clusters
Creating Public AKS Cluster with Azure CNI
Below script will create a new AKS cluster with application gateway with predefined subnets for both AKS and Application Gateway.
Benefits of using this script for customers to deploy the cluster with predefined network architecture of their choice and gives freedom to select whatever the IP ranges they wish for.
az aks create --name ex-pri-stg `
--resource-group EX-TEST `
--load-balancer-sku standard `
--node-count 1 `
--vnet-subnet-id "/subscriptions/<subscriptionid>/resourceGroups/EX-TEST/providers/Microsoft.Network/virtualNetworks/ex-in-test-app-vnet/subnets/ex-in-test1-app-subnet" `
--docker-bridge-address 172.17.0.1/16 `
--dns-name-prefix ex-pri-stg-dns `
--dns-service-ip 10.2.0.10 `
--service-cidr 10.2.0.0/24 `
--network-plugin azure `
--enable-managed-identity `
-a ingress-appgw `
--appgw-name ex-pri-ag-test-1 `
--appgw-subnet-id "/subscriptions/<subscriptionid>/resourceGroups/EX-TEST/providers/Microsoft.Network/virtualNetworks/ex-in-test-ag-vnet/subnets/ex-in-test1-ag-subnet" `
--node-vm-size Standard_B2s `
--generate-ssh-keysCreating Private AKS Cluster with Azure CNI
Below script will create a new AKS cluster with application gateway with predefined subnets for both AKS and Application Gateway. It registers the AKS API Server with private DNS.
Prerequisite for private DNS
Create Private DNS Zone with privatelink.<region>.azmk8s.io
Create User Managed Identity
Assign managed identity as
Private DNS zone contributor in private dns zone
Network Contributor in vnet or specific subnet
Create jump server in same subnet or vnet (or ensure the jump has access to Private DNS and VNet)
Register EnablePrivateClusterFQDNSubdomain to use custom private DNS
Creating Private AKS Cluster with Kubenet
Delete AKS Cluster
Last updated
Was this helpful?