Not able to associate more than 1 subnet to Kubernetes cluster via AKS

12/20/2018

When I create kubernetes cluster from kubernetes service of azure in the networking tab , I have the option to create my own virtual network.

Let's say I created a virtual network with 3 subnets , still in the networking tab options , I can only associate 1 of these subnet to my cluster.

Is it a restriction in AKS?

If so, why it allows to create more than 1 subnet in virtual network?

-- Saurabh
azure
azure-kubernetes
azure-virtual-network

1 Answer

12/20/2018

Not sure but you only can specific one subnet when you create an AKS cluster on the Azure portal. It seems a restriction in AKS. Read the prerequisites. At least, you need one subnet, one AKS cluster. Also, AKS supports a single pool for now.

Don't create more than one AKS cluster in the same subnet.

With advanced networking in AKS, you can deploy a AKS cluster in a existing virtual network and define these subnet names and IP address ranges. IP addresses for the pods and the cluster's nodes are assigned from the specified subnet within the virtual network. So you need to plan IP addressing for your cluster. You should consider doing upgrade and scaling operations when you determine the number of IP addresses.

The reason it allows to create more than 1 subnet in virtual network is that essentially you could create many subnets with valid CIDR block in a VNet. You can create VMs in other subnets or create a dedicated Gatewaysubnet used for VPN gateway in the existing VNet. With advanced networking, this existing virtual network often provides connectivity to an on-premises network using Azure ExpressRoute or Site-to-Site VPN.

Also, it's welcome to give feedback on Azure AKS to improve this feature. Hope this helps.

-- Nancy Xiong
Source: StackOverflow