DEV Community

Cover image for Stop Paying for Kubernetes Leftovers (Without Risking Production)
Raphael Ben Hamo
Raphael Ben Hamo

Posted on

Stop Paying for Kubernetes Leftovers (Without Risking Production)

Kubernetes waste usually isn’t a dramatic “bug.” It’s the slow accumulation of leftovers: volumes, services, configs, and credentials that were needed once, but no longer have a living workload attached to them.​​
Teams keep paying for these resources because deleting the wrong thing in production is risky — and manual checks don’t scale across namespaces and clusters.​​

The 3 kinds of Kubernetes waste
When people say “Kubernetes cost optimization,” they often jump straight to right-sizing CPU/memory. That’s real, but it’s only one category.​
In practice, Kubernetes waste usually falls into three buckets: orphaned resources, over-provisioned resources, and idle resources.​

This post focuses on the one that’s the most frustrating to deal with manually: orphaned resources — things that still exist, still cost money (or create risk), but are no longer referenced by any active workload.

What “orphaned” looks like in real clusters
Orphaned resources show up in multiple places, especially after migrations, incident fixes, Helm churn, and “temporary” environments that became permanent.​
Common examples include:

  • PersistentVolumes / PVCs that are no longer attached to running workloads.
  • Services with no active endpoints (nothing behind them anymore).
  • Secrets and ConfigMaps that have no live consumer, but still sit in the API and increase audit/attack surface.

The hard part isn’t understanding the list — it’s proving “unused” safely, because Kubernetes references can be indirect and spread across many objects.

Illustration Of KorPro

Why unused Secrets are so hard to clean up
Secrets don’t expire just because an app was removed. Over time, clusters quietly accumulate credentials with no clear owner.​
That creates a larger attack surface, harder audits, and operational uncertainty — because nobody wants to delete a Secret and discover it was still referenced somewhere obscure.​

Become a member
This is why simple heuristics (labels, naming conventions, “last applied,” or “created date”) don’t hold up in production. Kor (the open-source project behind KorPro) approaches it differently by building a reference graph across workloads and Kubernetes objects to determine whether a Secret is truly in use.​

A practical “audit-first” approach (what good looks like)
In production, the safest cleanup workflow is audit-first:

  • Scan clusters for unused/orphaned objects across namespaces.​
  • Enrich each finding with context (cost, health, risk) so humans can prioritize.
  • Generate a “safe-to-prune” review list — then decide what to delete and when (during a change window, with approvals).​​ That last step matters: a tool should help teams delete with confidence, but it shouldn’t auto-delete in production by default.​​

How KorPro helps (without installing anything in the cluster)
KorPro is built to discover and analyze unused Kubernetes resources across AWS (EKS), GCP (GKE), and Azure (AKS), with a “zero-installation” architecture that runs outside the cluster using read-only permissions.
It scans for unused resources (ConfigMaps, Secrets, Services, Deployments, PVCs, and more), then enriches findings with cost estimates (monthly/yearly), health/efficiency metrics, and security risk assessments.

Most importantly for real-world teams, KorPro follows an audit-first approach: it provides recommendations and a safe-to-prune checklist, but does not automatically delete resources — you keep control of production changes.​​

Try it on your cluster (free)
If you’re spending meaningful money on Kubernetes, it’s worth running a quick audit just to see what you’re still paying for from old environments, removed apps, and past migrations.​​
KorPro offers a free trial (up to 5 reports/month): https://app.korpro.io/signup​
If you want to see the output format first, there’s an interactive demo here: https://korpro.io/demo

Top comments (0)