Q: How would you use Kubernetes resource requests/limits to control costs?
Engineering methodology for eliminating 'phantom spend' in Kubernetes through container resource right-sizing, VPA recommendation mode, and intelligent node consolidation with Karpenter.
Want to master this scenario in a live sandbox? The Linux Foundation's FinOps Certified Practitioner (FOCP) Program covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: In Kubernetes, you pay for what you REQUEST, not what you use. If a developer requests 4 CPUs but the container only consumes 200m, the cloud provider bills you for 4 CPUs because the scheduler reserves the space. That gap is 'phantom spend'.
The Phantom Spend Trap (Request vs Actual)
How over-provisioned requests trigger unneeded cloud node scale-outs:
- Kube-scheduler treats
requestsas hard commitments. If node capacity is 8 vCPU, and two pods request 4 vCPU each, the node is 100% allocated. - Cluster Autoscaler / Karpenter is forced to provision a second EC2 node, even if the actual CPU utilization on the first node is only 5%!
- Result: Cloud bills double while clusters run at 10% actual hardware utilization.
Automated Right-Sizing Tools (Goldilocks & VPA)
Data-driven sizing replacing developer guesswork:
- Vertical Pod Autoscaler (VPA) in 'Off' (Recommendation) Mode: Analyzes historical container usage and outputs exact recommended requests for CPU and memory.
- Fairwinds Goldilocks: Dashboard that consumes VPA recommendations and highlights over-provisioned workloads across namespaces.
- Set requests to the p95 peak utilization + 15-20% headroom, allowing pods to burst safely without blocking node scheduling.
Dynamic Node Consolidation with Karpenter
Maximizing node packing density:
- Enable Karpenter
consolidationPolicy: WhenUnderutilized. - Karpenter constantly evaluates cluster bin-packing: if 3 nodes are 30% full, Karpenter cordons and drains one node, moves its pods onto the remaining nodes, and terminates the empty instance in real-time.
- Problem: Cloud billing follows requests, not usage. Over-requested pods force the cluster to spin up empty, expensive nodes.
- Solution 1: Deploy VPA in recommendation mode + Goldilocks to discover real p95 CPU/memory usage.
- Solution 2: Adjust requests down to actual p95 load + 20% buffer, freeing up node capacity.
- Solution 3: Implement Karpenter with consolidation enabled—it automatically merges sparse nodes and terminates unneeded EC2 instances.
- Result: 30–50% reduction in cluster compute spend with zero impact on application performance.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Engineering bespoke in-house developer tools instead of adopting standardized platform Golden Paths when configuring Kubernetes Resource Right Bespoke internal tools create long-term maintenance debt and fragmented workflows, whereas standardized Golden Paths accelerate delivery.
- Overlooking infrastructure cost visibility and FinOps allocation tagging across multi-tenant environments when configuring Kubernetes Resource Right Without granular resource tagging, engineering organizations cannot attribute cloud infrastructure costs to specific teams or business units.
- Failing to define explicit Service Level Objectives (SLOs) and Error Budgets to balance feature velocity with reliability when configuring Kubernetes Resource Right Without agreed SLOs, engineering and product teams lack an objective data-driven framework to prioritize technical debt over new features.
- Neglecting automated continuous drift detection between declarative configuration and deployed cloud state when configuring Kubernetes Resource Right Unmanaged drift accumulates over time, causing future automated deployments to fail or overwrite emergency manual adjustments.