# Orphaned Kubernetes Resources

Canonical: https://www.pointfive.co/efficiency-hub/inefficiencies/orphaned-kubernetes-resources

[Cloud Efficiency Hub](https://www.pointfive.co/efficiency-hub) 

# Orphaned Kubernetes Resources

## 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](https://hub.pointfive.co/inefficiencies/orphaned-kubernetes-resources)

## At a glance

Reference

CER-0270

Cloud provider

GCP

Service

GCP GKE

Category

[Compute](https://www.pointfive.co/efficiency-hub/service-category/compute)

Inefficiency type

Orphaned Resource

## Contributed by

- ### Yonah Dissen

---
Source: the public page above. Product screenshots and illustrative interfaces are examples, not live customer data.

