Explanation
Why the waste happens and who it affects.
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.
Billing model
The pricing dimensions that drive this cost.
GKE charges a cluster management fee for every cluster ($0.10 per cluster per hour, offset by a monthly free-tier credit equal to one zonal Standard or Autopilot cluster per billing account) and bills for underlying compute 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.
How to detect
6 checks to find it in your estate.
- PVCs & PVs
- List Bound PVCs (`kubectl get pvc -A`) and compare them with the claims referenced by pods (`spec.volumes[*].persistentVolumeClaim.claimName`); PVCs that no pod references are candidates (PVCs don't support a `status.phase` field selector). Map them 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 (check with GKE audit logs in Cloud Audit Logs, or a cleanup tool that scans workload specs for references).
- Unused Namespaces (dev/test TTL exceeded).
- GCP Recommender APIs for idle Persistent Disks and unattached external IPs.
How to fix
5 ways to remove the waste.
- 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
Documentation
Vendor references for pricing and configuration.