Kubernetes Resource Calculator
Configure CPU and memory requests and limits for your Kubernetes pods.
Set millicores, Mi/Gi memory, HPA replica bounds, and get production-ready YAML with a Namespace ResourceQuota.
Frequently Asked Questions
What is the difference between CPU requests and limits in Kubernetes?▼
CPU requests are what Kubernetes uses to schedule a pod onto a node — the scheduler ensures the node has at least that many free millicores. CPU limits cap how much CPU the container can consume after it's running. Exceeding the limit causes CPU throttling (not a crash), which degrades performance. Best practice: set the limit to ~2–5× the request to allow bursting.
What happens when a container exceeds its memory limit?▼
When a container exceeds its memory limit, the Linux kernel OOM (Out Of Memory) killer terminates the container with exit code 137. Kubernetes then restarts it according to the pod's restartPolicy. Unlike CPU throttling, memory over-limit is a hard kill. Always set memory limits to prevent one container from starving others on the same node.
What are millicores (m) in Kubernetes CPU?▼
Millicores represent 1/1000 of a CPU core. 1000m = 1 vCPU = 1 AWS vCPU or GCP vCPU. Common values: 100m (0.1 vCPU, for lightweight services), 500m (0.5 vCPU, for medium workloads), 1000m (1 vCPU, for CPU-intensive apps). If your node has 4 cores, it has 4000m total allocatable CPU.
How does HPA (HorizontalPodAutoscaler) use resource requests?▼
HPA calculates CPU utilization as a percentage of the pod's CPU request, not the limit. If your request is 100m and your target is 70%, HPA scales up when actual CPU usage exceeds 70m. This is why setting accurate requests is critical — too low causes premature scaling, too high causes underutilization.
What is a Namespace ResourceQuota and why use it?▼
A ResourceQuota limits the total resources consumed by all pods in a namespace. It prevents a single team or deployment from consuming the entire cluster's capacity. Quotas can cap total CPU requests/limits, memory requests/limits, and number of pods. They are enforced at admission time — pods that exceed the quota are rejected.
What are good starting values for CPU and memory limits?▼
For most web APIs: start with 100m CPU request / 500m CPU limit and 128Mi memory request / 512Mi memory limit. Run load tests, check actual usage with `kubectl top pods`, then adjust. As a rule of thumb: set request to ~50–70% of your measured P95 usage, and limit to ~150–200% of request to allow for traffic spikes without OOM kills.
Related Products
on GumroadGitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
Docker Run Command Builder
Build complete docker run commands visually. Configure image, ports, volumes, environment variables, network, restart policy, detached mode, and more. Generates the exact docker run command.
Open free tool →
Dockerfile Linter
Paste your Dockerfile and instantly check for common issues: latest tags, missing HEALTHCHECK, running as root, cache-busting COPY order, ADD vs COPY, and multi-stage build suggestions.
Open free tool →
YAML Validator Pro
Advanced YAML validator with line-number error reporting, JSON preview, and schema hints for common YAML pitfalls. Free, runs in your browser.
Open free tool →
More Free Tools
Related Articles
Docker Compose vs Kubernetes: When to Use Each (2026)
A practical guide to choosing between Docker Compose and Kubernetes in 2026. Compare complexity, use cases, cost, and learn when to migrate from one to the other.
Kubernetes Cost Optimization: A Practical Guide for 2026
Reduce your Kubernetes costs by 40-60% with rightsizing, VPA/HPA, spot instances, namespace quotas, and cost monitoring tools like Kubecost. Real examples included.
Pulumi vs Terraform 2026: Which IaC Tool Should You Choose?
A deep comparison of Pulumi and Terraform for infrastructure as code in 2026. Covers syntax, state management, provider ecosystem, team adoption, and when to choose each tool.
Docker vs Kubernetes: When to Use Each (2025 Guide)
Docker vs Kubernetes 2025: key differences, Docker Compose vs Kubernetes, cost comparison, and a clear decision framework with real-world use cases.
Docker vs Podman: Container Runtime Comparison 2026
Docker vs Podman container runtime comparison 2026: architecture, security, performance, migration guide, and when to choose each container tool.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →