Kubernetes v1.37: Tracking When a PersistentVolumeClaim Was Last Used (Beta)
Kubernetes v1.37 introduces the PersistentVolumeClaimUnusedSinceTime feature gate to Beta, enabled by default. This enhancement adds an "Unused" condition to each PersistentVolumeClaim (PVC) within its status. This condition directly indicates whether any running pod currently references the PVC. Previously, identifying unused PVCs was complex, requiring cross-referencing multiple Kubernetes objects and extensive custom scripting. The new feature simplifies this by natively reporting PVC usage status. A PVC is marked as Unused if no non-terminated pods reference it, and as Used if at least one running or pending pod is attached. Terminated pods, including those from completed batch jobs, do not count as actively using a PVC. The "Unused" condition also includes a lastTransitionTime field, which records when a PVC became idle. This allows administrators to easily identify PVCs that have been unused for specific durations, aiding in cost optimization and storage management. The feature, previously in Alpha in v1.36, has undergone extensive testing and is now on by default for Beta. Users can directly inspect the PVC status via kubectl to observe these changes. The Kubernetes project plans to move this feature to General Availability in a future release based on user feedback.
lastTransitionTimefield, which records when a PVC became idle. This allows administrators to easily identify PVCs that have been unused for specific durations, aiding in cost optimization and storage management. The feature, previously in Alpha in v1.36, has undergone extensive testing and is now on by default for Beta. Users can directly inspect the PVC status viakubectlto observe these changes. The Kubernetes project plans to move this feature to General Availability in a future release based on user feedback.