Kubernetes Pod and Service CIDR

Pod and service CIDR sizing, the per-node mask, and the node ceiling that falls out of them. Both ranges are fixed at cluster creation on every managed distribution, so this is the one sizing decision that cannot be revisited.

The kubeadm defaults are 10.244.0.0/16 for pods and 10.96.0.0/12 for services, with a /24 per node. Neither can be changed after the cluster exists.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Calculate. Nothing leaves this tab.

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Sizing the pod CIDR for today's node count

    Both CIDRs are fixed at cluster creation on most platforms and cannot be changed without rebuilding. A pod CIDR sized for fifty nodes stops the fifty-first joining.

    Instead:Size generously. Private address space costs nothing and the limit is permanent.

  2. Overlapping the pod or service CIDR with the VPC

    Routing becomes ambiguous, and peering or a VPN to anything using the same range fails in ways that are hard to diagnose from inside the cluster.

    Instead:Keep both ranges outside every network the cluster will ever reach.

  3. Forgetting the node CIDR mask sets pods per node

    A /24 per node gives 254 pods, and a /26 gives 62. That mask, not the kubelet's maxPods, is often the real ceiling.

    Instead:Compute nodes times pods-per-node against the pod CIDR before choosing the mask.

The per-node mask decides the node ceiling, and it is set once

Each node is carved a fixed slice of the pod CIDR. A /16 pod CIDR with a /24 per node allows 256 nodes and no more, and that arithmetic is fixed at cluster creation on every managed distribution.

A /24 per node gives 254 addresses and kubelet wants 110

kubelet defaults to 110 pods per node. When the per-node CIDR holds fewer addresses than that, the node runs out of pod IPs before it runs out of its pod limit, and new pods fail with a CNI allocation error rather than with anything naming the CIDR. A /25 per node gives 126 addresses, which is above 110 and doubles the node ceiling: that trade is usually the right one.

Overlapping ranges produce the strangest symptoms available

When the pod and service CIDRs overlap, an address can be a pod IP and a ClusterIP at once, and which one wins depends on the order rules were programmed into the dataplane. The result is intermittent connection failures to one service, which is close to undiagnosable from inside the cluster. The conventional pairing keeps them far apart for exactly this reason.

What this cannot see

Your CNI, which may not use the node-CIDR model at all: AWS VPC CNI assigns real VPC addresses and is bounded by the subnet and the instance type instead. Whether the ranges collide with something in your VPC or on-premises network, which is a routing question outside the cluster.

More kubernetes tools

Kubernetes YAML Generator Answer a few questions, get a manifest Kubernetes YAML Validator Is this YAML valid, and where is it wrong? Kubernetes Rollout & Probe Timing Restart loops, capacity dips and stuck drains Kubernetes Service Checker Will this Service have any endpoints? Kubernetes Network Policy Viewer What can reach what, and what just broke Kubernetes Manifest Diff What actually changed Kubernetes Resource Calculator What these manifests actually reserve Kubernetes RBAC Viewer Who can actually do what Kubernetes Deployment Generator See the capacity dip before you deploy Kubernetes Service Generator port, targetPort, and which one you meant Kubernetes StatefulSet Generator Stable names, and volumes that outlive you Kubernetes QoS Class Calculator And where you sit in the eviction order Kubernetes Node Capacity Planner Allocatable is not capacity Kubernetes Max Pods per Node Calculator The ENI limit, not the 110 default Kubernetes Label Selector Tester Which key failed, not just that one did Kubernetes Taint & Toleration Tester Tolerations permit, they do not attract Kubernetes Resource Name Validator RFC 1123 subdomain, label, or 1035 Kubernetes Label & Annotation Validator Why your image tag is not a legal label Kubernetes CrashLoopBackOff Guide The status is a timer, not a cause Kubernetes TLS Certificate Decoder When it expires, and what it covers Kubernetes ServiceAccount Token Decoder Bound or legacy, and when it dies Kubernetes imagePullSecret Generator The registry URL nobody gets right Kubernetes cert-manager Certificates Issuer scope, and the rate limit that costs a week Kubernetes Flux HelmRelease Generator With the source it cannot work without Kubernetes Helm Chart Generator Chart.yaml, values, and working templates Kubernetes Argo CD Application Generator The defaults that are off, turned on Kubernetes Ingress Generator pathType, and the TLS secret that fails quietly Kubernetes HPA Generator Why it says unknown and never scales Kubernetes SecurityContext Generator Pod level, container level, and which wins Kubernetes Probe Generator How long it gets to start before liveness kills it Kubernetes PVC Generator Access modes your storage can actually do Kubernetes ResourceQuota Generator And the LimitRange that stops it breaking deploys Kubernetes CronJob Generator The fields that decide whether it runs Kubernetes NetworkPolicy Generator With the DNS rule already in it Kubernetes RBAC Generator And what it actually grants Kubernetes PodDisruptionBudget Generator Can this budget ever be satisfied? Kubernetes API Deprecation Checker What breaks on the next upgrade Kubernetes Kubeconfig Viewer Read it without handing it to anyone Kubernetes Quantity Parser What 512Mi, 100m and 1e3 actually mean Kubernetes Multi-Document YAML Splitter One file per object, in apply order Kubernetes .env to ConfigMap & Secret Split the credentials out on the way Kubernetes Secret Decoder See what is actually in there Kubernetes Ingress to Gateway API Which annotations silently stop working Kubernetes Manifest Visualizer What points at what, and what points at nothing Kubernetes Patch Tester Which --type, and what it deletes Kubernetes kubectl JSONPath Tester kubectl's dialect, not generic JSONPath Kubernetes Node Affinity Tester Required excludes, preferred only scores Kubernetes Helm Values Diff A missing key is a third value Kubernetes Secret Encoder base64 is not encryption Kubernetes API Version Checker Will this apply on that cluster Kubernetes Go Template Tester Go truthiness is not JavaScript's Kubernetes Cluster Cost Estimator At your rates, not a price table Kubernetes Kustomize Build Transformers run in kustomize's order Kubernetes Helm Chart Validator version is SemVer, appVersion is not

Elsewhere on the site