PV Cleanup
Deletes PersistentVolume objects that no PVC uses, only after every protection check passes and only when you turn cleanup on, and logs each deletion.
The PVC was deleted 30 days ago. Its 100Gi PV still shows Released.
kubernetes.io, Persistent Volumes; Wave Auto Clean Up docs. 30 days and 100Gi are illustrative.
With the Retain reclaim policy, "when the PersistentVolumeClaim is deleted, the PersistentVolume still exists and the volume is considered released" (kubernetes.io). An administrator reclaims it by hand.
Wave cleanup is off by default. When you turn it on, it deletes only PVs that pass every protection check: no custom finalizer, no opt-out annotation, no existing PVC, and no VolumeAttachment.
Deleting the PV object is not the same as deleting the disk. Under Retain, "the associated storage asset in external infrastructure still exists after the PV is deleted" (kubernetes.io). Check the disk with your storage provider.
Released, Retain, and the storage asset: kubernetes.io, Persistent Volumes. Protection checks, the cleanup switch, and the statuses: Wave Auto Clean Up docs. data-db-0 and 100Gi are illustrative.
How Wave does it
- PVCdeleted along with its app
- RetainPVstill exists, phase Released
- waitsCluster adminfinds it and deletes it by hand
- by handStorage assetstill exists after the PV is deleted
- Wave Corescans every PV: Released, Available, or orphaned
- unusedProtection checksfinalizer, annotation, PVC, attachment
- eligibleCleanup switchoff by default; you turn it on
- deleteKubernetes APIPV deleted, logged InProgress, then Completed
Review the list first
Detection runs even while cleanup is off. Unused PV Detection lists each Released, Available, or orphaned PV with its reason, so you can check the list before anything is deleted.
Protect what must stay
Add waveautoscale.io/pv-cleanup: disabled to a PV, or to a StorageClass to protect every PV that uses it. PVs with a custom finalizer, such as velero.io/*, are never marked unused.
Turn cleanup on
Turn on Enable Auto Cleanup in Storage, PV Auto Cleanup. For each eligible PV, Wave calls the Kubernetes delete API and logs it as InProgress, then Completed or Failed.