Kubernetes IP Planning On-Premises - Pod CIDR, Node CIDR Mask, Service CIDR, Node VLAN and MetalLB Pool for kubeadm, RKE2, OpenShift, Mirantis MKE, Tanzu and Talos
TL;DR
- An on-premises cluster has four ranges: the node network (a real VLAN), the pod CIDR, the service CIDR and the LoadBalancer pool. Only the first is a network your switches know.
- Every node gets its own slice of the pod CIDR, a /24 by default. With
podSubnet: 10.42.0.0/16my three nodes received10.42.0.0/24,10.42.1.0/24and10.42.2.0/24, and each reported 110 allocatable pods (Kubernetes v1.37.0, 2026-11-30). - Nodes the pod CIDR can hold = 2^(node mask - pod prefix). A /16 with /24 per node is 256 nodes. A /24 pod CIDR is exactly one node: my second and third node stayed NotReady with
CIDRNotAvailable. - A smaller block per node does not lower the pod limit by itself. With
node-cidr-mask-size: 26each node got 64 addresses and the kubelet still advertised 110 pods. LowermaxPodstoo. - The MetalLB pool is a hard count. Four addresses, five Services: the fifth stayed
<pending>withFailed to allocate IP for "default/lb5": no available IPs. - The defaults differ per distribution (kubeadm and Talos 10.244.0.0/16, RKE2 10.42.0.0/16, OpenShift 10.128.0.0/14 with /23 per node, MKE 192.168.0.0/16 with Calico /26 blocks, Tanzu 100.96.0.0/11). The table in section 6 has them with a calculator link each.
- On a managed cloud cluster the rules are different: for EKS, GKE and AKS read the cloud companion of this post.
The Kubernetes IP Calculator has had an on-premises option since version 1.4.0. The arithmetic behind it is simple; what is worth a post is what a real cluster does with those numbers, because the control plane is far less forgiving than a form. So I built four small clusters on 2026-11-30 with kind v0.33.0, which bootstraps real kubeadm nodes (Kubernetes v1.37.0, containerd 2.3.4) in containers, and broke the addressing on purpose. kind's own CNI, kindnet, uses the pod CIDR that the controller manager assigns to each node, the same model as Flannel. What I say about Calico, Cilium, OpenShift, MKE, Tanzu and Talos comes from their documentation and from the calculator, which links every rule to its source; I did not install those here.
Table of Content
- The four ranges
- The pod CIDR and the block every node gets
- When the pod CIDR is too small
- Changing the block per node with node-cidr-mask-size
- The node VLAN and the MetalLB pool
- Defaults per distribution
- What broke when I ran this
- Conclusion
1. The four ranges
In a cloud the provider owns most of this. On-premises it is all yours, and it has to be decided before the first node boots:
| Range | What lives in it | Who routes it | Can it change later? |
|---|---|---|---|
| Node network | nodes, the control-plane virtual IP, the LoadBalancer pool | your switches and routers | it is a normal VLAN; renumbering nodes is painful but possible |
| Pod CIDR | one address per pod, handed out in a block per node | the CNI, inside the cluster | fixed at install on kubeadm, RKE2, k3s, MKE and Tanzu |
| Service CIDR | ClusterIP addresses, purely virtual | kube-proxy or the CNI | fixed at install on most distributions |
| LoadBalancer pool | one address per Service of type LoadBalancer | MetalLB or kube-vip answering on the node VLAN | a pool can be added at any time |
The usual warning from the CIDR basics applies three times over: the pod and service ranges must not overlap the node network, each other, or any network the pods have to reach, such as the database VLAN or the office range behind the VPN. A pod that wants to talk to 10.42.5.20 in your data centre will never leave the cluster if 10.42.0.0/16 is the pod CIDR.
2. The pod CIDR and the block every node gets
The configuration is two lines. With kubeadm they are --pod-network-cidr and --service-cidr (kubeadm init reference); kind passes the same values through its cluster configuration:
1kind: Cluster
2apiVersion: kind.x-k8s.io/v1alpha4
3networking:
4 podSubnet: "10.42.0.0/16"
5 serviceSubnet: "10.43.0.0/16"
6nodes:
7 - role: control-plane
8 - role: worker
9 - role: worker
Once the cluster is up, one command shows what the control plane did with the pod range:
1$ kubectl get nodes -o custom-columns=NAME:.metadata.name,PODCIDR:.spec.podCIDR,PODS:.status.allocatable.pods
2NAME PODCIDR PODS
3onprem-control-plane 10.42.0.0/24 110
4onprem-worker 10.42.1.0/24 110
5onprem-worker2 10.42.2.0/24 110
Each node owns a /24. That comes from two flags of the kube-controller-manager, which I read from the running pod:
1$ kubectl -n kube-system get pod -l component=kube-controller-manager -o jsonpath='{.items[0].spec.containers[0].command}' | tr ',' '\n' | grep -i 'cidr\|mask'
2"--allocate-node-cidrs=true"
3"--cluster-cidr=10.42.0.0/16"
There is no mask flag in that list, so the default applies: the kube-controller-manager reference says of --node-cidr-mask-size: "Default is 24 for IPv4 and 64 for IPv6". The 110 is the kubelet's maxPods, also a default; I confirmed it on a worker with kubectl get --raw /api/v1/nodes/onprem-worker/proxy/configz, which returned "maxPods":110 (kubelet configuration).
Pods then take addresses from the block of the node they land on, and Services from the other range:
1$ kubectl get pods -o custom-columns=POD:.metadata.name,NODE:.spec.nodeName,IP:.status.podIP
2POD NODE IP
3web-86d8686cfb-4b4sc onprem-worker2 10.42.2.4
4web-86d8686cfb-7rtcm onprem-worker2 10.42.2.3
5web-86d8686cfb-f5lxg onprem-worker2 10.42.2.5
6web-86d8686cfb-rcnsf onprem-worker2 10.42.2.2
7web-86d8686cfb-tswrb onprem-worker2 10.42.2.6
8web-86d8686cfb-w6blm onprem-worker2 10.42.2.7
9
10$ kubectl get svc -A
11NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
12default kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 23s
13kube-system kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP,9153/TCP 22s
14
15$ kubectl get servicecidr
16NAME CIDRS AGE
17kubernetes 10.43.0.0/16 24s
All six replicas landed on onprem-worker2 (both workers had joined only seconds earlier), and all six addresses are inside that node's 10.42.2.0/24. The API server holds the first address of the service range and cluster DNS the tenth; both Services were 23 seconds old when I listed them. The ServiceCIDR object is how current Kubernetes tracks the range (Service ClusterIP allocation).
So the sizing rule for the pod CIDR has two halves:
| Question | Formula | With /16 and /24 per node |
|---|---|---|
| How many nodes fit? | 2^(node mask - pod prefix) | 2^(24-16) = 256 nodes |
| How many pods per node? | block size - 2, capped by maxPods | 254 addresses, capped at 110 |
| How many pods in total? | nodes x pods per node | 256 x 110 = 28,160 |
3. When the pod CIDR is too small
"We will never have more than three nodes, a /24 is plenty for the pods." It is plenty for the pods and too small for the nodes. Same cluster, with podSubnet: "10.42.0.0/24":
1$ kubectl get nodes -o custom-columns=NAME:.metadata.name,STATUS:.status.conditions[-1].type,READY:.status.conditions[-1].status,PODCIDR:.spec.podCIDR
2NAME STATUS READY PODCIDR
3small-control-plane Ready True 10.42.0.0/24
4small-worker Ready False <none>
5small-worker2 Ready False <none>
6
7$ kubectl get events -A --field-selector reason=CIDRNotAvailable
8NAMESPACE LAST SEEN TYPE REASON OBJECT MESSAGE
9default 3s Normal CIDRNotAvailable node/small-worker Node small-worker status is now: CIDRNotAvailable
10default 3s Normal CIDRNotAvailable node/small-worker2 Node small-worker2 status is now: CIDRNotAvailable
The first node took the whole /24 as its block and nothing was left. The controller manager says so in its log, and it kept saying so, eight times in 8 seconds:
1E1130 03:40:14.605693 1 range_allocator.go:257] "Error processing node work item" err="error syncing 'small-worker2': failed to allocate cidr from cluster cidr at idx:0: CIDR allocation failed; there are no remaining CIDRs left to allocate in the accepte
(The line is cut at 400 characters by my capture; the full message ends "in the accepted range".) kind create cluster itself reported success, because it only waits for the control plane, and I had given it 90 seconds. The damage shows one layer down: both workers never become Ready, and even CoreDNS, scheduled on the one healthy node, sat in ContainerCreating 15 seconds after the cluster came up.
The fix is in the formula of section 2, and you cannot apply it afterwards: on kubeadm the pod CIDR is an install-time value. Three nodes with /24 blocks need at least a /22, and the calculator's answer for this exact input is blunt: "10.42.0.0/24 holds 2 nodes, you plan 3 ... Use a /23 pod CIDR, or a smaller block per node" (it tried a /25 per node to make anything fit at all).
4. Changing the block per node with node-cidr-mask-size
If the pod CIDR cannot grow, the block per node can shrink. On kubeadm that is node-cidr-mask-size on the controller manager, set through controllerManager.extraArgs:
1kind: Cluster
2apiVersion: kind.x-k8s.io/v1alpha4
3networking:
4 podSubnet: "10.42.0.0/24"
5 serviceSubnet: "10.43.0.0/16"
6kubeadmConfigPatches:
7 - |
8 kind: ClusterConfiguration
9 controllerManager:
10 extraArgs:
11 node-cidr-mask-size: "26"
12nodes:
13 - role: control-plane
14 - role: worker
15 - role: worker
1$ kubectl get nodes -o custom-columns=NAME:.metadata.name,PODCIDR:.spec.podCIDR,PODS:.status.allocatable.pods
2NAME PODCIDR PODS
3mask-control-plane 10.42.0.0/26 110
4mask-worker 10.42.0.128/26 110
5mask-worker2 10.42.0.64/26 110
The same /24 now holds four nodes of 64 addresses, and all three came up. But look at the last column. Each node has a block of 64 addresses, 62 usable for pods, and still tells the scheduler it can run 110 pods. The mask and maxPods are two independent settings on two different components. By the arithmetic, pod number 63 on such a node has no address to get; I did not push a node that far. When you shrink the block, set the kubelet's maxPods to fit it; the calculator flags this combination as "a /26 block holds 62 pods, maxPods asks for 110".
| Block per node | Addresses | Usable for pods | Nodes in a /16 | Sensible maxPods |
|---|---|---|---|---|
| /23 (OpenShift default) | 512 | 510 | 128 | 250 |
| /24 (kubeadm, RKE2, Talos default) | 256 | 254 | 256 | 110 |
| /25 | 128 | 126 | 512 | 110 |
| /26 | 64 | 62 | 1,024 | 60 |
| /27 | 32 | 30 | 2,048 | 28 |
Calico is the exception to "one block per node". Its IPAM hands out /26 blocks on demand and gives a busy node a second one (Calico IPPool reference), so with 110 pods per node you plan two blocks per node and a /16 holds 512 nodes, not 1,024. Cilium's cluster-pool mode works per node like the table, with a mask that the Cilium documentation says cannot be changed once set.
5. The node VLAN and the MetalLB pool
The node network is ordinary subnetting, with one Kubernetes twist: on-premises there is no cloud load balancer, so every Service of type LoadBalancer needs a real address from the node VLAN, announced by MetalLB in layer 2 mode. I gave MetalLB v0.16.2 a pool of four addresses and created five Services:
1apiVersion: metallb.io/v1beta1
2kind: IPAddressPool
3metadata:
4 name: lan-pool
5 namespace: metallb-system
6spec:
7 addresses:
8 - 172.18.255.200-172.18.255.203
9---
10apiVersion: metallb.io/v1beta1
11kind: L2Advertisement
12metadata:
13 name: lan
14 namespace: metallb-system
1$ kubectl get svc
2NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
3kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 70s
4lb1 LoadBalancer 10.43.75.119 172.18.255.200 80:30400/TCP 16s
5lb2 LoadBalancer 10.43.68.211 172.18.255.201 80:31881/TCP 15s
6lb3 LoadBalancer 10.43.137.215 172.18.255.202 80:32137/TCP 15s
7lb4 LoadBalancer 10.43.30.12 172.18.255.203 80:32156/TCP 15s
8lb5 LoadBalancer 10.43.145.94 <pending> 80:32347/TCP 15s
9
10$ kubectl describe svc lb5
11...
12Events:
13 Type Reason Age From Message
14 ---- ------ ---- ---- -------
15 Warning AllocationFailed 15s metallb-controller Failed to allocate IP for "default/lb5": no available IPs
Four Services had an address within 15 seconds; the fifth waits until one is released or the pool grows. Nothing else warns you. Unlike the pod CIDR, this one is fixable on a running cluster: add a second IPAddressPool. The addresses must be inside the node VLAN and outside the DHCP range, otherwise two machines will answer for the same address one day.
So the node VLAN is sized like this, and the reserved-address habits from usable addresses per subnet apply, minus the cloud's extra reservations:
nodes with growth + control-plane VIPs + LoadBalancer pool + 3 (network, broadcast, gateway), rounded up to a power of two.
For 50 nodes, one VIP and a pool of ten the calculator returns 61 addresses, a /26 with 61 usable, which is full on day one. I would take the /25.
6. Defaults per distribution
Every installer picks different defaults, and two of them collide with common office and data-centre ranges. This is the calculator's output for 50 nodes on each distribution, one VIP and ten LoadBalancer addresses; the links open the same plan in the tool, where every number carries the link to the vendor page it comes from.
| Distribution | CNI | Pod CIDR | Block per node | Nodes it holds | Pods per node | Service CIDR | Open |
|---|---|---|---|---|---|---|---|
| kubeadm | Flannel | 10.244.0.0/16 | /24 | 256 | 110 | 10.96.0.0/12 | plan |
| Rancher RKE2 / k3s | Canal | 10.42.0.0/16 | /24 | 256 | 110 | 10.43.0.0/16 | plan |
| Red Hat OpenShift | OVN-Kubernetes | 10.128.0.0/14 | /23 | 512 | 250 | 172.30.0.0/16 | plan |
| Mirantis MKE | Calico | 192.168.0.0/16 | /26, two per node | 512 | 110 | 10.96.0.0/16 | plan |
| VMware Tanzu Kubernetes Grid | Antrea | 100.96.0.0/11 | /24 | 8,192 | 110 | 100.64.0.0/13 | plan |
| Talos Linux | Flannel | 10.244.0.0/16 | /24 | 256 | 110 | 10.96.0.0/12 | plan |
The vendor pages behind those rows: RKE2 server configuration, the OpenShift Cluster Network Operator page for clusterNetwork and hostPrefix, MKE IP considerations, the Tanzu configuration reference and the Talos KubeNetworkConfig reference.
What I take from the table:
- MKE's default pod range is
192.168.0.0/16. That is the range of most office LANs and home routers. If anything your pods must reach lives there, change it before installing. - OpenShift gives every node a /23 (510 pod addresses) and the calculator uses 250 pods per node, the value in the OpenShift example, so a 50-node cluster reserves 25,600 addresses of pod space. The
hostPrefixcannot be changed after installation; the cluster network can only be widened. - Tanzu uses
100.64.0.0/10space, the carrier-grade NAT range, for pods and services. That avoids RFC 1918 collisions; check that your firewalls and NAT rules expect that range inside the data centre. - RKE2's
10.42.0.0/16and kubeadm's10.244.0.0/16are both inside10.0.0.0/8, which is where most companies keep their servers. Check the routing table of the data centre, not just the cluster.
For the planning problems that are not about on-premises at all (IP exhaustion on EKS, GKE secondary ranges, AKS subnet sizes), the planning-problems post and the calculator FAQ go through them one by one.
7. What broke when I ran this
A cluster that "created successfully" with two dead nodes. kind create cluster on the /24 pod range ended with its usual success message, and the first kubectl get nodes showed three nodes. Only the PODCIDR column, <none> for both workers, and the CIDRNotAvailable events told the truth. On a real kubeadm install the symptom is the same: kubeadm join succeeds and the node never becomes Ready. If you take one command from this post, take the custom-columns line from section 2 and run it after every join.
The error is in a log nobody tails. "CIDR allocation failed; there are no remaining CIDRs left to allocate in the accepted range" appears in the kube-controller-manager log, not on the node, not in kubectl describe node beyond the event, and not in the output of the join. I found it with kubectl -n kube-system logs -l component=kube-controller-manager | grep -i cidr.
110 pods on a 62-address node. I expected the kubelet to derive its pod limit from the block it was given. It does not: with node-cidr-mask-size: 26 every node still reported 110 allocatable pods. The scheduler believes that number.
My own readiness check lied. The STATUS and READY columns in the section 3 output come from .status.conditions[-1], the last condition in the list, which is the Ready condition; "Ready False" means NotReady. I kept the output as it was printed, but kubectl get nodes without custom columns is the clearer way to see it.
The fifth LoadBalancer was silent. No alert, no failed deployment, just <pending> in a column people stop reading. The event on the Service is the only message.
8. Conclusion
- Write down four ranges before installing: node VLAN, pod CIDR, service CIDR, LoadBalancer pool. Check each against the networks the cluster must reach.
- Pod CIDR size = nodes at the end of the cluster's life x the block per node. A /16 with /24 blocks is 256 nodes; a /24 is one.
- If you shrink the block with
node-cidr-mask-size(orhostPrefix, or Cilium's mask), lowermaxPodsto match. - Size the MetalLB pool for the Services you will have, and reserve it in your IPAM.
- After every node join:
kubectl get nodes -o custom-columns=NAME:.metadata.name,PODCIDR:.spec.podCIDR,PODS:.status.allocatable.pods.
The Kubernetes IP Calculator does steps 1 to 4 for the six distributions above and has a Config tab with the settings for the numbers you choose. The rest of the Kubernetes series is in the index.
Did this save you a debugging session? Stay in the loop -
- Subscribe on YouTube - every post here has a screen-recorded companion video.
- Code on GitHub - the repositories, Terraform and scripts behind these posts.
Learn more On Kubernetes -
- Setup kubernetes on Ubuntu
- Setup Kubernetes on CentOs
- Setup HA Kubernetes Cluster with Kubespray
- Setup HA Kubernetes with Minikube
- Setup Kubernetes Dashboard for local kubernetes cluster
- Setup Kubernetes Dashboard On GCP(Google Cloud Platform)
- How to use Persistent Volume and Persistent Volume Claims in Kubernetes
- Deploy Spring Boot Microservice on local Kubernetes cluster
- Deploy Spring Boot Microservice on Cloud Platform(GCP)
- Setting up Ingress controller NGINX along with HAproxy inside Kubernetes cluster
- CI/CD Kubernetes | Setting up CI/CD Jenkins pipeline for kubernetes
- kubectl export YAML | Get YAML for deployed kubernetes resources(service, deployment, PV, PVC....)
- How to setup kubernetes jenkins pipeline on AWS?
- Implementing Kubernetes liveness, Readiness and Startup probes with Spring Boot Microservice Application?
- How to fix kubernetes pods getting recreated?
- How to delete all kubernetes PODS?
- How to use Kubernetes secrets?
- Share kubernetes secrets between namespaces?
- How to Delete PV(Persistent Volume) and PVC(Persistent Volume Claim) stuck in terminating state?
- Delete Kubernetes POD stuck in terminating state?
- Kubernetes IP Calculator - the free tool that sizes node subnets, Pod ranges and max pods per node for EKS, GKE and AKS
- Kubernetes IP address planning - 22 problems the calculator solves on EKS, GKE, AKS and on-premises (kubeadm, Mirantis MKE, RKE2, OpenShift, Tanzu, Talos)