How pod capacity is calculated
The scheduler fits pods into each node's allocatable resources, using their requests. The calculator follows the same steps:
- Start from the node's CPU and memory.
- Subtract what the kubelet reserves for the OS, the container runtime and itself (kube-reserved, system-reserved and the eviction threshold). The amount depends on the platform: pick yours under Reserved resources, or enter the numbers yourself. The result is allocatable.
- Subtract the requests of resident pods, including DaemonSets. Count those pods against the node's total pod limit separately.
- Compute how many workload pods fit by CPU requests, memory requests and available pod slots. The smallest number sets the workload capacity.
Whichever resource runs out first is the limiting factor. If CPU limits you while half the memory sits idle, a node type with a different CPU-to-memory ratio will usually cost less for the same workload.
To compare what GKE, AKS and EKS leave on the same node size, use the Kubernetes allocatable calculator. Not sure what a value such as 250m or 1Gi comes to? The Kubernetes CPU units converter turns it into cores, and the Kubernetes memory units converter into exact bytes.
Worked example
The default 4 vCPU, 16 GiB node uses GKE's formula for node pools created on 1.36 or earlier. After platform reserves and resident requests, 3.72 cores and about 12.9Gi remain. For pods requesting 500m and 1Gi each, CPU allows seven pods and memory allows twelve. The default assumes zero occupied slots, so CPU limits the workload to seven pods per node and 20 replicas take three nodes.
For a slot-limited example, set Max pods per node to 10 and Resident pods per node to 2. With small requests of 10m and 10Mi per workload pod, eight fit per node and 20 replicas still need three nodes. Enter the count and requests from your own node pool before using the estimate.
Provider reserve formulas still use the total configured pod limit where applicable. For EKS, fill in the separate instance-type limit when it differs from the node's max pods.
Pitfall: limits without requests
If a container sets a limit but no request, Kubernetes copies the limit and uses it as the request, unless a LimitRange in the namespace applies a default first. A 4Gi memory limit can therefore become a 4Gi request. Look up the requests applied to your actual pods when estimating capacity.
Leave headroom
The node count is a steady-state estimate for identical nodes. Leave enough schedulable CPU, memory and pod slots for a Deployment's rollout surge. Check the surviving nodes separately for a node or zone loss. Distribution constraints and other scheduling rules can limit where replacements fit.
A PodDisruptionBudget limits eligible voluntary evictions, such as a node drain. Plan capacity for involuntary failures and rollouts separately. Node autoscaling can add nodes for unschedulable pods. Allow time for provisioning and for the new nodes to become schedulable.
FAQ
Does Kubernetes schedule pods based on requests or limits?
The scheduler checks CPU and memory requests against the node's allocatable resources. It also checks for a free pod slot. If a container has a limit but no request, Kubernetes can use the limit as its request.
What is allocatable versus capacity?
Capacity is the raw CPU and memory of the machine. Allocatable is what is left for pods after the kubelet subtracts kube-reserved, system-reserved and the eviction threshold. Run kubectl describe node and look for the Capacity and Allocatable sections to see the real numbers on your cluster.
How much do GKE, AKS and EKS reserve on each node?
Each platform uses its own formula, and the calculator offers all of them. GKE node pools created on 1.36 or earlier reserve 6% of the first CPU core down to 0.25% above four cores, and 25% of the first 4 GiB of memory down to 2% above 128 GiB. GKE node pools created on 1.37 or later reserve the lower of that memory figure and 15 MiB per max pod plus a 500 MiB base on Container-Optimized OS, and at most 1 CPU core. AKS 1.29 and later reserves about 20 MB per max pod plus 50 MB of memory, capped at 25% of the node, and 60m to 740m of CPU on 1 to 64 cores. EKS Amazon Linux AMIs reserve 11 MiB per pod the instance type supports, plus 255 MiB of memory, and use the same CPU tiers as GKE. Every platform adds a 100 MiB eviction threshold. These formulas cover Linux nodes only. For Windows nodes, or to match a node exactly, choose Enter manually and use Capacity minus Allocatable from kubectl describe node.
Why is there a max pods per node limit?
Every node runs a limited number of pods, and each platform sets its own default. GKE Standard defaults to 110 and allows up to 512, set per node pool. AKS defaults to 250 with Azure CNI Overlay and allows at most 250, also set per node pool. On EKS with the VPC CNI the limit depends on how many IP addresses the instance type can attach, for example 29 on an m5.large without prefix delegation, and managed node groups cap it at 110 below 30 vCPUs and 250 above. On GKE 1.37 or later and on AKS, max pods also sets how much memory is reserved, so enter the real value. EKS reserves memory from the max pods the instance type supports, even when a managed node group or the kubelet config sets a different limit, so the calculator has a separate field for it.
How do resident pods affect capacity?
Count the DaemonSet pods and other pods already scheduled on each node. Each uses one pod slot, even without CPU or memory requests. Their combined requests also reduce the CPU and memory available for your workload. For example, two agents on a 10-slot node leave eight slots.
What do the CPU and memory units mean?
CPU is measured in cores, and 1000m (millicores) equals one core, so 250m is a quarter of a core. Memory uses bytes with binary suffixes (Ki, Mi, Gi = powers of 1024) or decimal ones (k, M, G = powers of 1000). 1Gi is about 7% larger than 1G.