The average Kubernetes cluster runs at 30-40% utilization. That means 60-70% of your compute spend is wasted. Here is how to fix it without sacrificing reliability.
Find the Waste First
Before optimizing, measure:
# Check resource requests vs actual usage
kubectl top pods -A | sort -k3 -rn | head -20
# Find pods with no resource limits
kubectl get pods -A -o json | jq -r \
'.items[] | select(.spec.containers[].resources.limits == null) |
"\(.metadata.namespace)/\(.metadata.name)"'The gap between what pods request and what they actually use is your optimization opportunity.
Right-Size Resource Requests
Over-requesting is the biggest cost driver. A pod that requests 2 CPU cores but uses 0.1 is holding 1.9 cores hostage.
Use the Vertical Pod Autoscaler (VPA) in recommendation mode:
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: my-app-vpa
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: my-app
updatePolicy:
updateMode: "Off" # Recommendation onlyVPA watches actual usage and suggests right-sized requests. Review its recommendations weekly and adjust.
Master this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Cluster Autoscaler + Spot Instances
Run your base workload on on-demand instances. Handle burst capacity with spot/preemptible instances at 60-90% discount:
# Node pool for spot instances
apiVersion: v1
kind: Node
metadata:
labels:
node-type: spot# Schedule fault-tolerant workloads on spot
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 80
preference:
matchExpressions:
- key: node-type
operator: In
values: ["spot"]
tolerations:
- key: "spot"
operator: "Equal"
value: "true"Batch jobs, dev environments, and stateless workers are ideal spot candidates.
Namespace Resource Quotas
Prevent any single team from consuming the entire cluster:
apiVersion: v1
kind: ResourceQuota
metadata:
name: team-quota
namespace: team-commerce
spec:
hard:
requests.cpu: "20"
requests.memory: 40Gi
limits.cpu: "40"
limits.memory: 80Gi
persistentvolumeclaims: "10"Quotas create accountability. Teams that hit their quota must optimize before requesting more.
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Scale Down Non-Production
Development and staging environments do not need to run 24/7:
# Scale down dev namespace at night
kubectl scale deployment --all -n dev --replicas=0
# KEDA can automate this based on schedulesRunning dev clusters only during business hours (10 hours/day, 5 days/week) saves ~70% on those workloads.
Pod Disruption Budgets with Autoscaling
Combine HPA with PDB so the autoscaler can scale down safely:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: my-app-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: my-appThis ensures the cluster autoscaler can remove underutilized nodes while maintaining availability.
Quick Wins Checklist
- Delete unused PVCs — orphaned persistent volumes cost money silently
- Set resource requests on all pods — unrequested resources cannot be optimized
- Use
requestsnot justlimits— the scheduler uses requests for bin-packing - Review load balancer count — each cloud LB costs $15-20/month, consolidate with ingress
- Check for idle namespaces — feature branch environments that were never cleaned up
Start with right-sizing. It is the highest-impact, lowest-risk optimization.
---
Ready to go deeper? Master Kubernetes resource management with hands-on courses at CopyPasteLearn.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
Karpenter Kubernetes Autoscaler
Karpenter provisions the right Kubernetes nodes in seconds, not minutes. Learn how it replaces Cluster Autoscaler with faster, smarter node provisioning.
Kubecost Kubernetes Cost Monitoring
Kubecost shows real-time cost allocation per namespace, deployment, and label in Kubernetes. Learn how to install Kubecost, identify waste, and set budgets.
Crossplane Infrastructure as Code
Crossplane lets you manage cloud infrastructure using Kubernetes custom resources. Learn how it works, how it compares to Terraform, and when to choose.
Kubernetes Deployment Strategies
Deploy safely with Kubernetes strategies. Rolling updates, blue-green, canary releases, recreate mode, and automated rollback.
Kubernetes ETCD Backup and Restore
Back up and restore Kubernetes etcd. Snapshot procedures, automated schedules, restore workflows, and cluster health verification.
Kubernetes Helm Hooks and Testing
Use Helm hooks for database migrations, post-deploy verification, and rollback safety. Plus helm test and CI pipeline strategies.
Explore topics
Browse more articles on the topics covered here.