Submit feedback on
Orphaned Kubernetes Resources
We've received your feedback.
Thanks for reaching out!
Oops! Something went wrong while submitting the form.
Close
Orphaned Kubernetes Resources
Yonah Dissen
Service Category
Compute
Cloud Provider
Azure
Service Name
Azure AKS
Inefficiency Type
Orphaned Resource
Explanation

Kubernetes environments often accumulate unused resources over time as applications evolve. Common examples include Persistent Volume Claims (PVCs) backed by Azure Disks, Services that trigger load balancer provisioning, or stale ConfigMaps and Secrets. When the associated deployments or pods are removed, these resources may remain unless explicitly deleted.

In AKS, this can lead to unmanaged costs, such as idle managed disks from orphaned PVCs or public load balancers from Services of type LoadBalancer. Even lightweight resources like unused Secrets or ConfigMaps degrade cluster hygiene and can introduce security or operational risk. This inefficiency is common across Kubernetes environments and is scoped here to AKS.

Relevant Billing Model

While AKS clusters do not charge for the control plane, costs arise from the underlying compute (VMs or node pools), storage (e.g., managed disks from PVCs), and networking (e.g., public IPs and load balancers from Services). Orphaned Kubernetes objects—such as PVCs, Services, ConfigMaps, and Secrets—may persist beyond the lifecycle of the workloads that created them, causing unnecessary consumption of Azure resources and cost.

Detection
  • Review Kubernetes objects not linked to active Deployments, StatefulSets, or running Pods
  • Check across all namespaces, not just default (default should never be deleted
  • Check for PVCs not mounted by any current workload
  • kubectl get pvc --all-namespaces to check PVC usage
  • Identify Services of type LoadBalancer that are not backed by any endpoints
  • kubectl get svc -o wide to identify LoadBalancer services
  • Confirm whether any retained Services have public IPs or Azure Load Balancers associated
  • Locate Secrets and ConfigMaps with old creation dates and no recent usage
  • Validate that no Jobs or CronJobs are expected to recreate workloads using these resources
  • kubectl get secrets,configmaps --show-labels for unused resources
Remediation
  • Before deletion, verify resources are truly orphaned
  • Delete orphaned PVCs to release Azure Managed Disks
  • Remove Services that no longer front active workloads to deallocate Load Balancers and public IPs
  • Clean up unreferenced ConfigMaps and Secrets
  • Use scheduled audits or automation tools to identify and clean up orphaned resources regularly
Relevant Documentation
Submit Feedback