COSP10 Research Hub All articles
Emerging Technology Analysis

Zombie Infrastructure: The Idle Kubernetes Tax Your Cost Dashboard Will Never Show You

COSP10 Research Hub
Zombie Infrastructure: The Idle Kubernetes Tax Your Cost Dashboard Will Never Show You

The Bill That Doesn't Match the Work

Every month, platform engineering teams across the United States open cloud invoices and perform the same ritual: they reconcile compute charges against active workloads, verify storage utilization against known datasets, and sign off on a figure that appears, on the surface, to be accounted for. What that reconciliation process rarely surfaces is the category of infrastructure that is neither actively running nor cleanly decommissioned — resources that exist in a kind of operational limbo, consuming real budget while contributing zero measurable value.

This is the phantom load problem. It is not caused by misconfigured autoscalers or runaway batch jobs. It is caused by the ordinary lifecycle of Kubernetes-managed workloads operating in organizations where provisioning is fast and deprovisioning is slow, manual, or simply forgotten.

Understanding why this happens requires examining the architectural mechanics of Kubernetes itself — specifically, the gap between what the orchestration layer considers "done" and what the underlying cloud infrastructure considers billable.

How Kubernetes Creates Orphaned Resources by Design

Kubernetes is an extraordinarily effective tool for provisioning compute. It is a considerably less effective tool for ensuring that what it provisions gets cleaned up. This asymmetry is not a bug; it reflects deliberate design choices that prioritize availability and stability over resource reclamation.

Consider the lifecycle of a persistent volume claim. When a stateful application is deployed, Kubernetes provisions underlying cloud storage — an EBS volume on AWS, a Persistent Disk on GCP — and binds it to the workload. When that workload is removed, the persistent volume claim may remain, depending on the reclaim policy configured at provisioning time. The default reclaim policy for dynamically provisioned volumes has historically been Retain in many configurations, which means the storage persists indefinitely after the pod that consumed it is gone.

The same dynamic applies to namespaces. Teams routinely create namespaces for feature branches, staging environments, or one-time experiments. The namespace and its associated resources — ConfigMaps, Secrets, service accounts, network policies — survive long after the context that created them has been dissolved. In large organizations running hundreds of namespaces across multiple clusters, the accumulated overhead of this namespace sprawl can represent a non-trivial fraction of total infrastructure spend.

Load balancers present an even sharper version of this problem. Cloud-provisioned load balancers created by Kubernetes Service objects of type LoadBalancer carry fixed hourly costs regardless of whether they are receiving traffic. When the service is deleted without explicit cleanup of the underlying cloud resource — a failure mode that occurs regularly during rushed teardowns — the load balancer continues to accrue charges against the account indefinitely.

Why Traditional Cost Allocation Tools Miss This Entirely

Most cloud cost management platforms — whether native tools like AWS Cost Explorer or third-party solutions — operate on a tagging and attribution model. Resources are assigned to cost centers via tags, and spend is aggregated by those dimensions. This model has a fundamental blind spot: it assumes that every billable resource is associated with a tag that corresponds to an active team or project.

Orphaned resources are, by definition, resources that have outlived the context that would have produced accurate tagging. A persistent volume created six months ago for a feature branch that was merged and abandoned in week two carries whatever tags were applied at provisioning time — or no tags at all. Neither case allows a cost management tool to flag the resource as anomalous.

Kubernetes-native cost tools such as Kubecost improve on this picture by correlating cloud spend with cluster-level resource consumption, but they are still fundamentally oriented toward measuring active workloads. Resources that exist outside the active scheduling context — detached volumes, unused IP addresses, idle load balancers with no healthy backends — often fall outside the measurement boundary entirely.

A Systematic Audit Methodology

Addressing phantom infrastructure requires a structured audit approach that operates at the intersection of the Kubernetes API and the cloud provider API — a layer that neither tool typically covers alone.

The first step is reconciliation between Kubernetes-declared resources and cloud-provisioned resources. For persistent volumes, this means querying both the cluster's PersistentVolume objects and the cloud provider's storage inventory, then identifying volumes that appear in the cloud inventory but have no corresponding in-use PVC binding. Any such volume that has been in the Released or Available state for more than a defined threshold — fourteen days is a reasonable starting point — is a candidate for review and decommissioning.

For load balancers, the equivalent reconciliation involves querying the cloud provider's load balancer inventory and cross-referencing each entry against the cluster's active Service objects. Load balancers with no healthy targets registered — a condition that cloud providers surface through their respective health check APIs — represent a strong signal of orphaned resources.

Namespace hygiene requires a different approach. Rather than reconciling against external cloud resources, the audit here focuses on activity signals within the cluster itself: last deployment timestamp, recent pod creation events, and active network traffic into the namespace. A namespace with no pod activity and no inbound traffic for thirty or more days warrants a formal review cycle before any automated action is taken.

Automation should be introduced cautiously. Automated deletion of persistent volumes carries irreversible consequences if the audit logic contains errors. A safer initial posture is automated flagging combined with a human review gate, with automated deletion reserved for resource types — such as unattached IP addresses — where the cost of a false positive is low.

The Organizational Pattern Behind the Technical Problem

Phantom infrastructure is ultimately a symptom of an organizational pattern as much as a technical one. In environments where provisioning is self-service and deprovisioning is not, the natural incentive structure produces accumulation. Engineers who provision resources for a specific purpose have no structural incentive to ensure complete cleanup once that purpose is served — the cost is invisible to them, the effort is non-trivial, and the downside of leaving something running is diffuse.

Addressing this sustainably requires embedding cleanup obligations into the provisioning workflow itself. Time-to-live annotations on namespaces, enforced by a controller that flags or terminates resources past their declared expiry, shift the default from indefinite persistence to bounded lifecycle. Requiring cost center attribution at provisioning time — enforced through admission webhooks rather than convention — ensures that orphaned resources remain attributable even after the context that created them has dissolved.

The signal that phantom infrastructure sends is worth decoding carefully. An organization that cannot account for its idle infrastructure almost certainly cannot account for its active infrastructure with precision either. Closing that measurement gap is not merely a cost optimization exercise — it is a prerequisite for making reliable architectural decisions at scale.

All Articles

Related Articles

The Buffer Blindspot: How Network Queuing Behavior Collapses Distributed System Performance at Scale

The Buffer Blindspot: How Network Queuing Behavior Collapses Distributed System Performance at Scale

Benchmark Theater: How Synthetic Performance Gains Vanish Before They Reach the User

Benchmark Theater: How Synthetic Performance Gains Vanish Before They Reach the User

Billed for Nothing: The Scheduling Overhead and Daemon Tax Quietly Draining Enterprise Cloud Budgets

Billed for Nothing: The Scheduling Overhead and Daemon Tax Quietly Draining Enterprise Cloud Budgets