Kubernetes Node Capacity Planner

Work out what a node can actually schedule. Give it the advertised size, the reservation formula your provider uses and the pod you want to pack onto it, and it subtracts kube-reserved, system-reserved, the eviction threshold and your DaemonSets, then bin packs what is left and shows the stranded remainder. It is arithmetic on the numbers you type, not a measurement of a cluster.

The node, as the cloud advertises it

Capacity. This is the number on the instance type page, and it is not the number the scheduler gets to use.

Held back before any pod is scheduled

Allocatable = capacity - kube-reserved - system-reserved - eviction threshold. The provider formulas below are published ones, they have changed with the node image more than once, and the authority for any given node is kubectl describe node.

What is already on every node

DaemonSets land on every node before your workload gets any of it. They are the line people leave out when sizing, and on a small node they are a fifth of it.

The pod you want to pack onto it

Requests, not usage. The scheduler places by request and never looks at what the container actually consumes.

node-capacity.txt

updates as you type

    Common mistakes

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

    1. Planning against capacity rather than allocatable

      The kubelet reserves memory and CPU for the system and for itself, plus an eviction threshold. Allocatable is meaningfully smaller and is what the scheduler uses.

      Instead:Plan against allocatable.

    2. Forgetting the eviction threshold

      The node begins evicting before memory is exhausted, so usable memory is lower again than allocatable suggests.

      Instead:Leave headroom above the threshold.

    3. Assuming reservations scale with instance size

      They are configured, not derived, and a large node with default reservations wastes proportionally less but still wastes.

      Instead:Check the actual kube-reserved and system-reserved values on your nodes.

    Why a node hands the scheduler less than it advertises

    The size on the instance type page is a billing figure. The number the scheduler places pods against is allocatable, which is that figure less what the kubelet holds back for itself, less what it holds back for the operating system, less the hard eviction threshold. Then the DaemonSets take their share on every node before your workload gets any of it. Every step is published arithmetic, and it is invisible until you put the instance type and kubectl describe node side by side.

    Capacity is what you pay for, allocatable is what can be scheduled

    kubectl describe node prints both blocks, one under the other, and they are different numbers. Allocatable is capacity less kube-reserved, less system-reserved, less the hard eviction threshold. Nothing in that subtraction is visible on the instance type page, so a sizing exercise done from the instance list is wrong before it starts. The share grows as the node shrinks: on the regressive schedule GKE publishes, the first 4Gi of any node is reserved at 25%, so a 4Gi node hands over a quarter of its memory before the eviction threshold comes off as well.

    16Gi node, EKS, --max-pods=110
    
    capacity           16384Mi
    kube-reserved      -1465Mi   255 + 11 x 110
    hard eviction       -100Mi   memory.available<100Mi
                       --------
    allocatable        14819Mi   what the scheduler sees
    
    kubectl describe node prints Capacity and
    Allocatable as two separate blocks. The instance
    type page prints only the first one.

    The reservation formula is per provider, and on EKS it moves with --max-pods

    EKS reserves memory per pod slot rather than per gibibyte: the AMI bootstrap script uses 255MiB plus 11MiB for every pod in --max-pods. That couples the two questions, so lowering the pod ceiling gives memory back to your workload and raising it with prefix delegation takes memory away. GKE reserves on a regressive schedule and AKS moved to one, which means small nodes lose a much larger share than big ones. A self-managed kubelet with none of the flags set reserves nothing at all, which is how a node ends up with sshd competing with pods for memory. CPU is the same regressive schedule on all three and is rarely what the reservation costs you.

    EKS      255MiB + 11MiB per pod slot
               110 pods ->  1465Mi
                58 pods ->   893Mi   lower ceiling,
                                     more for pods
               250 pods ->  3005Mi   prefix delegation,
                                     paid for in memory
    
    GKE, AKS   25% of the first 4Gi
               20% of the next 4Gi
               10% of the next 8Gi
                6% of the next 112Gi
                2% of everything above 128Gi
    
    CPU        6% of core 1, 1% of core 2, 0.5% of
               cores 3 and 4, 0.25% above four
               4 vCPU -> 80m
    
    The published tables are written in decimal units
    while a kubelet measures in binary, so a boundary
    value can land a percent or two either side.

    The eviction threshold is capacity that can never hold a pod

    The hard eviction threshold is subtracted from allocatable, not held in reserve behind it. The kubelet default is memory.available<100Mi, so 100Mi of every node is paid for and unschedulable by design. Raising it to protect the node against a spike costs allocatable one for one. The other default, nodefs.available<10%, is about disk: it does not appear in the memory arithmetic at all, and it is what evicts pods on a node whose image cache has filled up.

    --eviction-hard=memory.available<100Mi   default
    --eviction-hard=memory.available<500Mi   -400Mi
                                             of
                                             allocatable
    
    nodefs.available<10%   disk, not memory. Evicts
                           pods on a node with a full
                           image cache, and does not
                           change the numbers above.

    DaemonSets come off every node, and they take pod slots too

    A DaemonSet is subtracted once per node, not once per cluster, and it is scheduled before your workload and tolerates most taints, so the capacity is gone whether or not anything else lands there. The usual set is a CNI agent, kube-proxy, a log shipper, a node exporter and a CSI node plugin. Sum their requests rather than their usage, because requests are what the scheduler subtracts. Leaving them out is the single most common reason a sizing exercise comes out one node short.

    per node   300m   500Mi   6 pods
    
    3 nodes    900m  1500Mi  18 of the 330 pod slots,
                             gone before your workload
                             gets any of it
    
    They are also the reason a node that looks empty
    in kubectl top has no room left in
    kubectl describe node.

    Pods per node is the lowest of three ceilings

    The answer is the smallest of three floor divisions: what fits by CPU, what fits by memory, and what is left of --max-pods after the DaemonSet pods. A request of zero does not constrain anything, so a BestEffort pod is limited only by the slot count. Which of the three binds is the useful part, because it names the lever: CPU or memory means a different instance shape, and pod slots means the node is too large for the pods on it.

    allocatable less DaemonSets   3620m   14319Mi
    one pod requests               500m    1024Mi
    
    by CPU         floor(3620 / 500)     =   7
    by memory      floor(14319 / 1024)   =  13
    by pod slots   110 - 6               = 104
                                           ---
    pods per node                            7
                                    bound by CPU
    
    stranded       120m and 7151Mi: schedulable,
                   billed, and too small to hold
                   another pod of this shape

    The scheduler packs by requests, and this packing is an upper bound

    The scheduler never looks at what a container consumes. A cluster can report every node as full while the metrics show 20% CPU, and both are true at once, because the requests are the reservation and the reservation is what gets subtracted. Everything above is also an upper bound on placement: pod anti-affinity, topology spread constraints, taints, node affinity and PVC zone binding all reduce the set of nodes a given pod may actually land on. A cluster that fits on paper and not in practice is usually a spread constraint rather than a capacity problem. And none of this is a measurement: it is arithmetic on numbers typed into a form, so the node itself is the only authority on the node.

    allocatable   3920m   14819Mi
    
    kubectl describe node ip-10-0-1-23
    Allocated resources:
      Resource   Requests      Limits
      cpu        3800m (96%)   6 (153%)
      memory     14336Mi (96%) 20Gi
    
    kubectl top node ip-10-0-1-23
      CPU 21%   MEMORY 34%
    
    Both are correct at the same time. Only the first
    one decides whether the next pod is scheduled.

    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 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 Pod and Service CIDR Fixed at cluster creation 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