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
GCP
Service Name
GCP GKE
Inefficiency Type
Orphaned Resource
Explanation

In GKE environments, it is common for unused Kubernetes resources to accumulate over time. Examples include Persistent Volume Claims (PVCs) that retain provisioned Persistent Disks, or Services of type LoadBalancer that continue to front GCP external load balancers even after the backing pods are gone. ConfigMaps and Secrets may also linger, creating operational overhead.

These orphaned objects often persist due to gaps in CI/CD teardown logic, manual testing workflows, or drift over time. While some carry negligible cost on their own, others can result in significant charges, especially storage and networking artifacts. This inefficiency applies broadly across Kubernetes platforms and is scoped here to GKE.

Relevant Billing Model

GKE charges for the control plane in certain tiers and always bills for underlying node resources (e.g., Compute Engine VMs), storage (e.g., Persistent Disks provisioned by PVCs), and network resources like external load balancers created by Services. Orphaned Kubernetes objects—such as Services, PVCs, ConfigMaps, or Secrets—can lead to idle infrastructure costs, especially when they trigger or retain provisioned GCP resources.

Detection
  • PVCs & PVs
  • `kubectl get pvc -A --field-selector=status.phase!=Bound`; map to GCP PDs via `gcloud compute disks list --filter="-users:*"`
  • Services of type LoadBalancer with 0 endpoints (`kubectl get ep -A`). Cross‑check for dangling forwarding rules/IPs.
  • ConfigMaps / Secrets not referenced in any `Deployment`, `StatefulSet`, `CronJob`, or `Job` in the last *n* days (audit via kube‑audit‑export or OPA‑Gatekeeper).
  • Unused Namespaces (dev/test TTL exceeded).
  • GCP Recommender APIs for *idle Persistent Disks* and *unattached external IPs*.
Remediation
  • Remove PVCs to deprovision underlying Persistent Disks
  • Delete unused Services to avoid charges for external Load Balancers and reserved IPs
  • Clean up ConfigMaps and Secrets not in use
  • Regularly audit clusters for orphaned resources using policy checks or automation
  • Tag PVCs with owner/team labels for accountability
Relevant Documentation
Submit Feedback