PersistentVolume
Does ZopNight manage PersistentVolume?
PersistentVolumes represent real cloud disks that bill per provisioned GB whether Bound, Released, or Available. ZopNight records reclaimPolicy, claimRef, and the CSI volume handle (the raw vol- ID on EBS) to join a PV to its still-billing disk, and flags Released volumes plus Available ones unclaimed for over 7 days.
Rules that fire on PersistentVolume
A PersistentVolume is the cluster-side handle on a real storage asset: an EBS volume, a Persistent Disk, an Azure Disk. The disk underneath bills per provisioned GB in every phase the PV can be in, which is what makes this object worth auditing.
Released still bills; only deletion stops the meter
When a PVC is deleted, its PV moves to the Released phase: the claim is gone, the data and the cloud disk remain, and the disk keeps billing. A Released PV also cannot be rebound without manual intervention, so it tends to sit forever. Discovery lowercases the phase into the resource status, one of bound, released, or available, and records capacity in GB, so the released population is directly queryable.
Reclaim policy is the switch that decides what deletion deletes
The PV’s reclaimPolicy is captured for exactly this reason. With Delete, removing the claim removes the cloud disk and its bill; with Retain, removing the claim strands the disk until someone cleans it up out of band. Retain is the safe default for data you cannot lose and the expensive default for everything else.
The CSI handle that ties a PV to an invoice line
For CSI-provisioned volumes, discovery records the driver and the csiVolumeHandle. On the EBS CSI driver that handle is the raw vol-... ID, which is byte-identical to the AWS EBS volume resource UID. That equality lets a Released or Available PV be joined straight to the still-billing cloud disk, so the orphaned storage can be priced rather than merely listed. A claimRef of the form namespace/name is kept while a claim exists.
How the released-volume rule decides
The Released PersistentVolume rule (RC-1741 on EKS, RC-1841 on GKE, RC-1941 on AKS, medium severity) fires on two shapes: any PV in Released phase, and any Available PV with no claimRef that has existed for more than 7 days. The dwell keeps freshly provisioned volumes and statically pre-provisioned PVs awaiting a claim from being flagged, and the rule abstains when the creation timestamp is missing rather than guessing.
kubectl get pv -o custom-columns=NAME:.metadata.name,PHASE:.status.phase,RECLAIM:.spec.persistentVolumeReclaimPolicy,CLAIM:.spec.claimRef.name,SIZE:.spec.capacity.storage