The Practical Guide to Kubernetes Cost Optimization
Arjun Mehta
Principal Cloud Architect
Kubernetes gives you unlimited scale — and unlimited cloud bills. In this guide, we break down exactly where Kubernetes costs leak and how to plug them.
Where the money leaks
1. Over-provisioned nodes. Most clusters run 40–60% average utilization. Teams size for peak, then pay for idle capacity around the clock.
2. Unbounded requests. Every pod that requests 2 CPUs per replica adds up fast. Rightsizing requests to measured usage is the single highest-leverage change.
3. No horizontal scaling. HPA configured, but with aggressive metrics and no limits, your cluster scales up and never scales back down.
4. Missing autoscaling for the cluster itself. Cluster Autoscaler + Karpenter are not optional — they are the core of cost control.
The 5-step framework we use
1. Instrument cost allocation first
Tag everything, adopt OpenCost, and give every team a dashboard of their own spend. You cannot fix what you cannot see.
2. Rightsize requests with VPA in "offline" mode
Run the Vertical Pod Autoscaler in recommend-only mode for two weeks, then apply the 95th-percentile recommendations.
3. Scale down aggressively
Use HPA with utilization targets around 50–70%, add scale-to-zero for non-critical workloads, and use KEDA for queue-driven scaling.
4. Mix spot capacity
Move stateless and batch workloads to spot instances (typically 60–90% cheaper). Target 40–60% spot coverage on non-production, 20–40% in production.
5. Revisit node sizes
Favor a few instance families that match your real workload shape. For memory-heavy services, memory-optimized nodes beat generic compute.
What we typically deliver
On a typical 12-node production cluster, this framework cuts spend 40–55% in the first 90 days while improving p95 latency, because pods land on better-matched hardware.
The key insight: Kubernetes cost optimization is not a one-time project. It is a weekly habit. Build the dashboards, set the reviews, and let the platform enforce the norms for you.
Arjun Mehta
Principal Cloud Architect at NxtPrism