Kubernetes Resource Planner
Plan Kubernetes cluster capacity from pod count, CPU and memory requests, replicas and headroom to get total vCPU, GiB, node count and monthly cost.
Kubernetes Resource Planner
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: Total Resources = Pods x Resource_Per_Pod x Replicas x (1 + Buffer%)
Worked example — 45 pods | 27 vCPU buffered | 27 GiB buffered | 9 nodes | ~$1,080/mo
Formula
Total Resources = Pods x Resource_Per_Pod x Replicas x (1 + Buffer%)
Total cluster resources are calculated by multiplying the number of service pods by per-pod resource requests, then by replica count for high availability, and finally adding the buffer percentage for headroom. Node count is derived by dividing total resources by per-node allocatable capacity (total minus system reservations). Limits are set at 2x CPU requests and 1.5x memory requests.
Worked Examples
Example 1: Microservices Platform Sizing
Problem:15 microservices, each requesting 500m CPU and 512 MiB memory, with 3 replicas each and 20% buffer.
Solution:Total pods: 15 x 3 = 45 Total CPU request: 45 x 500m = 22,500m = 22.5 vCPU Total memory request: 45 x 512 MiB = 23,040 MiB = 22.5 GiB With 20% buffer: 27 vCPU, 27 GiB Nodes (4 vCPU, 16 GiB): ~7 pods/node by CPU, need 7 nodes + buffer = 9 nodes Estimated cost: ~$1,080/month for nodes
Result:45 pods | 27 vCPU buffered | 27 GiB buffered | 9 nodes | ~$1,080/mo
Example 2: API Gateway High-Traffic Setup
Problem:5 API gateway pods requesting 1000m CPU, 1024 MiB memory, with 5 replicas and 30% buffer.
Solution:Total pods: 5 x 5 = 25 Total CPU: 25 x 1000m = 25,000m = 25 vCPU Total memory: 25 x 1024 MiB = 25,600 MiB = 25 GiB With 30% buffer: 32.5 vCPU, 32.5 GiB Nodes: ~3 pods/node by CPU, 9 nodes + buffer = 12 nodes
Result:25 pods | 32.5 vCPU buffered | 32.5 GiB buffered | 12 nodes | ~$1,440/mo
Frequently Asked Questions
What is the difference between resource requests and limits in Kubernetes?
Resource requests define the minimum resources a pod needs and are used by the scheduler to decide which node to place the pod on. Limits define the maximum resources a pod can consume. If a pod exceeds its memory limit, it gets OOM-killed (out of memory). If it exceeds its CPU limit, it gets throttled but not killed. Best practice is to set requests based on typical usage and limits based on peak usage. A common starting point is limits at 2x requests for CPU and 1.5x for memory. Setting requests too low causes resource contention; setting limits too high wastes cluster capacity and money.
How do I determine the right resource values for my pods?
Start with observation rather than guessing. Deploy your application with generous initial resources, then use monitoring tools like Prometheus with Kubernetes Metrics Server to observe actual CPU and memory usage over several days including peak traffic periods. The Vertical Pod Autoscaler (VPA) in recommendation mode can suggest values automatically. Set requests to the P95 (95th percentile) of observed usage and limits to the maximum observed spike plus 20% headroom. For CPU, focus on average usage for requests since CPU is compressible. For memory, focus on peak usage since exceeding memory limits causes pod termination.
How many pods can fit on a single node?
This depends on three constraints: CPU capacity, memory capacity, and the Kubernetes pod limit per node (default 110 for most distributions, 250 for some). Not all node resources are available for pods — the kubelet, OS, and system daemons reserve roughly 10% of CPU and about 1 GiB of memory. For a standard 4-vCPU, 16-GiB node, allocatable resources are approximately 3.6 vCPU and 15 GiB. With pods requesting 250m CPU and 256 MiB memory, you can fit about 14 pods by CPU or 60 by memory — so CPU is the bottleneck. Always calculate both dimensions and take the lower number.
What buffer percentage should I use?
A 15-25% buffer is standard for production workloads. This accounts for node failures, rolling deployments (which temporarily run extra pods), traffic spikes, and system overhead. For highly variable workloads or services with strict availability SLAs, consider 30-40%. For development and staging environments, 10-15% is typically sufficient. The buffer applies to overall cluster capacity, not individual pod resources. With cluster autoscaling enabled, you can use a smaller static buffer (10-15%) since the autoscaler will provision additional nodes when demand increases, though scaling up takes 2-5 minutes.
How do I optimize Kubernetes costs?
The biggest cost lever is right-sizing: most organizations over-provision CPU requests by 3-5x. Run resource audits monthly using tools like Kubecost, Goldilocks, or kubectl top. Second, use node auto-scaling to match capacity with demand instead of provisioning for peak. Third, use spot or preemptible instances for fault-tolerant workloads (saves 60-90%). Fourth, implement Horizontal Pod Autoscaler (HPA) to scale pods based on actual metrics. Fifth, consider resource quotas and limit ranges to prevent any single team from over-provisioning. Organizations that actively manage Kubernetes resources typically reduce cloud spend by 30-50%.
What are Quality of Service classes and how do they decide which pod gets evicted?
Kubernetes assigns each pod a QoS class from its requests and limits alone. Guaranteed means every container sets a limit equal to its request for both CPU and memory. Burstable means requests are set but are lower than the limits. BestEffort means neither is set at all. When a node runs short of memory the kubelet evicts BestEffort pods first, then Burstable pods that are exceeding their requests, and Guaranteed pods last. Setting requests equal to limits therefore buys scheduling stability at the price of reserving capacity the workload may never touch.
Why does a container get CPU-throttled while the node still has idle cores?
CPU limits are enforced by the Linux Completely Fair Scheduler as a quota within a fixed accounting period, 100 milliseconds by default. A container limited to 250m may use only 25 milliseconds of CPU time in each period; once it exhausts that, it is stalled until the next period begins even if every other core on the node is idle. Bursty, latency-sensitive services suffer badly from this, showing up as tail-latency spikes with low average utilisation. Raising the limit, or removing the CPU limit while keeping the request, is the usual remedy.
What is the difference between the Horizontal Pod Autoscaler, the Vertical Pod Autoscaler and the Cluster Autoscaler?
They act on three different axes. The HPA changes the replica count of a workload in response to metrics such as CPU utilisation or a custom queue depth, so it adds more pods of the same size. The VPA changes the requests and limits inside pods based on observed usage, making each pod the right size, and usually has to restart pods to apply them. The Cluster Autoscaler adds or removes nodes when pods cannot be scheduled or nodes sit empty. Running the HPA and the VPA on the same CPU or memory metric conflicts, since both react to the same signal.
What exactly is a millicore, and how do Mi and Gi differ from MB and GB?
CPU is expressed in millicores where 1000m equals one full core-second of CPU time per wall-clock second, so 250m is a quarter of a core and can be satisfied by time-slicing rather than a dedicated core. Memory uses binary suffixes: 1 Ki is 1024 bytes, 1 Mi is 1,048,576 and 1 Gi is 1,073,741,824. The decimal suffixes M and G mean powers of 1000 instead, so 1 Gi is about 7.4 percent larger than 1 GB. Mixing them silently under-provisions memory, which is why manifests should use Mi and Gi consistently.
Why would a pod stay Pending after I apply the manifest?
Almost always because no node has enough unreserved allocatable capacity to satisfy the pod's requests, which the scheduler reports on the pod as an Unschedulable condition naming insufficient cpu or insufficient memory. Note that this is decided on requests, not on actual usage, so a cluster showing 30 percent real utilisation can still refuse to schedule if requests are over-declared. Other common causes are node selectors or affinity rules with no matching node, taints without a matching toleration, and hitting the per-node pod cap of 110. Cluster autoscaling reacts to exactly this signal by provisioning another node.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer · Editorial policy
Related Calculators
☸️Kubernetes Resource Request Limit Rightsizer
Optimize Kubernetes CPU and memory requests/limits based on actual usage for cost savings
🧮EV Route Charge Planner Range AI
Calculate ev route charge planner range ai with inputs, formulas, and instant results.
🧮Work Break Pomodoro Planner AI
Calculate work break pomodoro planner ai with inputs, formulas, and instant results.
🧮Allergen Exposure Planner
Calculate allergen exposure planner with inputs, formulas, and instant results.
🧮API Rate Limit Planner
Calculate api rate limit planner with inputs, formulas, and instant results.
🧮Hydration Planner Activity Climate
Calculate hydration planner activity climate with inputs, formulas, and instant results.
🧮Public Transit Transfer Planner
Calculate public transit transfer planner with inputs, formulas, and instant results.
🧮Retirement Path Planner Glide
Calculate retirement path planner glide with inputs, formulas, and instant results.