Kubernetes Resource Calculator

Paste your manifests and see what they actually reserve: total CPU and memory across every replica, the QoS class per workload, how many nodes it needs, and the gap between what is reserved and what those pods are allowed to burst to.

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 Add it up. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

Requests but no memory limit

A container that can grow until the node evicts something, including itself

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 3
  template:
    spec:
      containers:
        - name: app
          resources:
            requests:
              cpu: 100m
              memory: 128Mi

Total across replicas

What the scheduler must find, which is requests times replicas

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 10
  template:
    spec:
      containers:
        - name: app
          resources:
            requests:
              cpu: 500m
              memory: 1Gi
            limits:
              cpu: 500m
              memory: 1Gi

Common mistakes

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

  1. Omitting a memory limit

    Memory is incompressible. Without a limit a container grows until the kernel OOM kills something on the node, not necessarily itself.

    Instead:Always set a memory limit. Equal to the request gives Guaranteed.

  2. Setting a CPU limit to guarantee CPU

    The request is the guarantee; the limit is a throttle that applies even when the node is idle.

    Instead:Set requests carefully and be cautious with CPU limits.

  3. Sizing from one replica

    The scheduler must find requests times replicas, and a request that fits once may not fit ten times.

    Instead:Size against the total and the largest node.

What it works out

The arithmetic is simple. Knowing which number the cluster is sized by is the part that saves money.

The number the bill is based on

A cluster is sized by the sum of requests, not by usage. Every replica of every container reserves its request whether it uses it or not, so a workload asking for 2 CPU and using 0.2 is being paid for ten times over. This adds it all up and draws the reserved capacity to scale against what those pods may burst to.

Init containers counted correctly

They run to completion before the app starts, so a pod reserves the larger of the init and the running requirement rather than the sum. Tools that add them together overstate what a cluster needs, sometimes considerably when a migration container asks for far more than the app.

QoS class per workload

Guaranteed, Burstable or BestEffort, using Kubernetes' own rules: Guaranteed needs request to equal limit for both CPU and memory on every container. This is what decides which pods get killed first when a node runs out of memory, and BestEffort pods go first.

CPU limits and the throttling trap

A limit far above the request means the container is throttled the moment it uses what it was told it could. Throttling is applied per 100ms period, so a burst that needs 50ms of full CPU is stretched across several periods and appears as latency nothing in the dashboards explains.

Requests, limits, and why the difference costs money

Two numbers per resource per container, and almost every Kubernetes cost and reliability problem traces back to how they were chosen. They do different jobs and confusing them is expensive in both directions.

A request is a reservation

The scheduler subtracts every pod's request from a node's allocatable capacity and will not place a pod that does not fit. That reservation is held whether the container uses it or not, which means requests decide how many nodes you run, and therefore what you pay. Nothing else in Kubernetes affects the bill as directly.

node: 4 CPU allocatable

pod A requests 1 CPU, uses 0.1   -> 1 CPU reserved
pod B requests 1 CPU, uses 0.1   -> 1 CPU reserved
pod C requests 1 CPU, uses 0.1   -> 1 CPU reserved
pod D requests 1 CPU, uses 0.1   -> 1 CPU reserved

node is full. actual usage: 0.4 CPU out of 4.

A limit is a ceiling, enforced differently for each resource

CPU is compressible, so exceeding a CPU limit throttles the container: it keeps running, more slowly. Memory is not compressible, so exceeding a memory limit kills it: the container is OOMKilled and restarted, mid-request. That asymmetry is why a memory limit should almost always equal the memory request, and why a CPU limit is a more debatable choice.

QoS decides who dies first

Kubernetes classifies every pod from its requests and limits, and uses that class when a node runs out of memory. Guaranteed pods are evicted last, BestEffort first. This is not configurable directly: you get the class your numbers imply, which is why a pod you consider critical can be first in the queue simply because nobody set its requests.

Guaranteed   every container sets both, and request == limit
Burstable    something is set, but not matching
BestEffort   nothing set at all

evicted first: BestEffort, then Burstable over its request,
then Guaranteed

CPU throttling is per 100ms, not per second

A limit of 500m does not mean half a core averaged over a second. The kernel gives the container 50ms of CPU in every 100ms period, and when that is spent the container waits, even if the node is idle. A request handler needing 80ms of solid CPU therefore takes at least 150ms of wall clock. This is why a service can show p99 latency far above its median while every CPU graph looks calm.

Init containers reserve, but do not add

Init containers run one at a time and finish before the app containers start. A pod's effective request is therefore the larger of the biggest init container and the sum of the running containers, not the total of both. A migration init container asking for 2 CPU sets the floor for scheduling that pod, but does not permanently reserve 2 CPU on top of the app.

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 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 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