az network vnet subnet list --resource-group EX-TEST --vnet-name ex-test-ag-vnet
Install 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.
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
-------------------------
Enable Feature
-------------------------
az feature register --namespace "Microsoft.ContainerService" --name "EnablePrivateClusterFQDNSubdomain"
-------------------------
Check registration status
-------------------------
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/EnablePrivateClusterFQDNSubdomain')].{Name:name,State:properties.state}"
-------------------------
Refresh the provider
-------------------------
az provider register --namespace Microsoft.ContainerService