← Back to Blog
Tutorial·6 min read·December 5, 2024

How to Find Kubernetes Waste in 5 Minutes

A step-by-step guide to identifying over-provisioned pods, orphaned load balancers, and idle resources. No agents required.

The Quick Way: Run a Free Audit

The fastest way to find waste in your Kubernetes cluster is to run this one command:

curl -sL wozz.io/audit.sh | bash

This runs locally on your machine, analyzes your cluster's resource configurations, and shows you:

  • Total estimated annual waste
  • Over-provisioned pods (memory & CPU)
  • Orphaned load balancers
  • Unbound persistent volumes
  • Top offenders by namespace

Privacy note: The script runs 100% locally. No data leaves your machine unless you explicitly use the --push flag.

The Manual Way: kubectl Commands

If you prefer to investigate manually, here are the key commands:

1. Find Over-Provisioned Memory

Compare requested memory vs actual usage:

# Get current memory usage
kubectl top pods --all-namespaces --sort-by=memory

# Compare to requests
kubectl get pods --all-namespaces -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.containers[*].resources.requests.memory}{"\n"}{end}'

Look for pods where usage is less than 50% of requests. These are candidates for right-sizing.

2. Find Over-Provisioned CPU

Same approach for CPU:

# Get current CPU usage
kubectl top pods --all-namespaces --sort-by=cpu

# Compare to requests
kubectl get pods --all-namespaces -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.containers[*].resources.requests.cpu}{"\n"}{end}'

3. Find Orphaned Load Balancers

Load balancers without backend pods cost $15-25/month each:

# List all LoadBalancer services
kubectl get svc --all-namespaces -o wide | grep LoadBalancer

# Check each one has endpoints
kubectl get endpoints -n <namespace> <service-name>

If a LoadBalancer service has no endpoints (or endpoints with 0 ready addresses), it's orphaned.

4. Find Unbound Persistent Volumes

PVs in "Available" status are allocated but not used:

kubectl get pv | grep Available

These volumes are being billed but not serving any workload.

5. Find Pods Without Resource Requests

Pods without requests can't be properly scheduled and make cost tracking impossible:

kubectl get pods --all-namespaces -o json | jq -r '.items[] | select(.spec.containers[].resources.requests == null) | .metadata.namespace + "/" + .metadata.name'

What to Do With Your Findings

Priority 1: Delete Orphaned Resources

These are pure waste—resources billing you for nothing. Delete them immediately.

Priority 2: Right-Size Top Offenders

Focus on the 10-20% of pods that generate 80% of waste. Usually these are:

  • Legacy services with "safe" limits from years ago
  • Batch jobs over-provisioned for worst-case scenarios
  • Dev/staging workloads with production-sized limits

Priority 3: Add Requests to Unbounded Pods

Set requests based on observed usage over 7-14 days.

Common Waste Patterns

PatternTypical WasteFix
8Gi limit, 500Mi usage$50/pod/monthRight-size to 1Gi
Orphaned LoadBalancer$20/month eachDelete service
Unbound 100GB PV$10/monthDelete or attach
No requests setUnpredictableAdd requests

Automate Waste Detection

Manual audits are useful but don't scale. For continuous monitoring:

Push audit results to track over time
curl -sL wozz.io/audit.sh | bash -s -- --push

This saves your results to a dashboard where you can:

  • Track waste trends over time
  • Get alerts when waste increases
  • Generate PDF reports for leadership
  • See breakdowns by namespace/team

Run Your First Audit

Takes 2 minutes. Works with EKS, GKE, AKS, and any Kubernetes cluster.

curl -sL wozz.io/audit.sh | bash

Summary

Finding Kubernetes waste doesn't require complex tools or agents. A simple audit can reveal thousands of dollars in monthly savings from over-provisioned resources and orphaned infrastructure.

Start with the automated audit, investigate the findings, and prioritize fixes by impact.