Kubernetes Cluster CIDR / Subnet Planner
Work out the per-node pod subnet size your cluster needs, whether your pod CIDR block is big enough for your node count, and exactly how many pod IPs you can address.
Example per-node subnets
How to use this tool
- Enter the pod CIDR block assigned to the whole cluster — the value you pass as
--cluster-cidror set aspodSubnetin kubeadm, e.g.10.244.0.0/16. - Enter your node count and the max pods per node you plan to run, matching kubelet’s
--max-pods(110 is the default and the tested ceiling for most setups). - The tool computes the smallest per-node subnet that can hold that many pod IPs, then checks whether your cluster CIDR has enough of those subnets for your node count.
- If it does not fit, either widen the cluster CIDR (a shorter prefix, like moving from /20 to /16) or lower max pods per node — both shrink the per-node subnet requirement.
- The example table shows the actual subnet each of the first few nodes would receive, so you can sanity-check the math against what you see in
kubectl get nodes -o wideornode.spec.podCIDR.
Every node in a Kubernetes cluster gets its own slice of the cluster’s pod CIDR, and every pod scheduled on that node draws its IP from that slice. The controller manager (or cloud provider’s IPAM) hands out one subnet per node, sized by --node-cidr-mask-size, and once a node’s slice is fully allocated no more pods can schedule there even if the node has plenty of CPU and memory left. Getting this sizing wrong is a genuinely common outage: a cluster that silently stops scheduling pods on otherwise healthy nodes almost always traces back to a pod CIDR that was too small for the node count, discovered only once real traffic showed up.
The sizing math is a straightforward capacity problem once you separate its two halves. First, how big does one node’s subnet need to be: it must hold at least as many addresses as the node’s max-pods setting, so the required subnet is the smallest power of two greater than or equal to that number — 110 max pods needs 128 addresses, which is a /25, not a /24, even though kubeadm’s actual default is the more generous /24. Second, how many of those per-node subnets fit inside the cluster CIDR: that is just the address-space ratio between the cluster block and the node block, e.g. a /16 cluster CIDR holds 256 /24 node subnets, or 512 /25 node subnets.
kubeadm’s own default of a /24 per node (256 addresses) with a 110 max-pods default is deliberately generous rather than the bare mathematical minimum — it leaves headroom for the loopback and any reserved addresses a particular CNI plugin sets aside, and it keeps the arithmetic simple. Cloud-managed clusters often expose this as a single dropdown (GKE’s \”maximum pods per node\”) that quietly picks the node subnet size for you using the same power-of-two logic this tool implements directly.
The failure mode to plan around is running out of node subnets, not running out of pod IPs within a node. A /16 pod CIDR with /24 nodes supports 256 nodes total — comfortably more than almost any cluster needs — but the same /16 with a smaller max-pods setting shrinking nodes to /25 or /26 supports 512 or 1,024 nodes, while a tighter cluster CIDR like /20 with /24 nodes tops out at just 16 nodes. Because the cluster CIDR is set once at cluster creation and resizing it later typically means rebuilding the cluster, it is worth sizing for growth up front rather than for the node count you have on day one.
One more gotcha worth knowing: subnetting math ultimately treats an IP address as a 32-bit number, and cluster CIDRs commonly start above 128.0.0.0 (the 172.16.0.0/12 private range, for instance) — large enough to come out negative under naive 32-bit signed-integer arithmetic in some languages and tools. It rarely bites Kubernetes itself, but it is a real source of bugs in home-grown IPAM scripts. This tool deliberately does all its address math with plain unsigned arithmetic to avoid that class of error.
Frequently asked questions
Why is my per-node subnet a /25 when kubeadm’s default is /24?
kubeadm’s default of /24 (256 addresses) is deliberately more generous than the mathematical minimum for a 110 max-pods setting, which only strictly needs 128 addresses (a /25). The extra headroom is intentional, not a sign your numbers are wrong.
What actually breaks if the cluster CIDR is too small for my node count?
New nodes stop receiving a pod subnet from the controller manager, and pods fail to schedule on them with a networking-related error even though the node itself reports healthy. It typically surfaces gradually as you scale past whatever node count the CIDR happened to support.
Can I resize the cluster CIDR after the cluster is already running?
Generally no, not in place — the pod CIDR is set at cluster creation (or kubeadm init) and changing it usually means creating a new cluster and migrating workloads. This is the main reason to size it for future growth rather than your current node count.
Does max pods per node include system pods like the CNI agent or kube-proxy?
If they run in the host network namespace they do not consume a pod IP, but any that get a normal pod IP count toward the same limit as your application pods. Leave a small margin above your expected application pod count for this reason.
Why does the tool recommend against raising max-pods above 110?
110 is the value Kubernetes documents as tested and supported by default across common CNI plugins. Raising it works in many setups, but it is no longer the well-tested default path, so confirm your specific CNI and node type handle the higher density before depending on it in production.