45
Plan IP addressing for AKS configured with Azure CNI Networking
When configuring Azure Kubernetes Service with Azure Container Network Interface (CNI), every pod gets an IP address of the subnet you’ve configured.
So how do you plan you address space? What factors should you consider?
With all that in mind the formula to calculate the number of IPs required for your cluster should look like this:
requiredIPs = (nodes + 1 + scale) + ((nodes + 1 + scale) * maxPods) + isvc
where:
To help you with this I’ve created a small console program written in golang: aksip which performs the necessary validations and calculations for you.
Let’s say you want a 50 node cluster with one internal load balancer that also includes provision to scale up an additional 10 nodes:
Just run:
aksip -n 50 -s 10
The output will show that you’ll need 1892 IP addresses and therefore a /21 subnet or larger:
{
"nodes": 50,
"scale": 10,
"maxPods": 30,
"isvc": 1,
"requiredIPs": 1892,
"cidr": "/21"
}
Hope it helps!!!
References:
45