if delete PV but change status to terminating :
$ kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE
postgres-pv 20Gi RWO Retain Terminating kubevious/data-kubevious-mysql-0 <unset> 41h
Steps to Force Delete the Stuck PersistentVolume
- Patch the PV to Remove Finalizers: This will allow the PV to be deleted without waiting for any finalizers to complete.
$ kubectl patch pv postgres-pv -p '{"metadata":{"finalizers":[]}}' --type=merge
Delete the PV:
After removing the finalizers, delete the PV:
kubectl delete pv postgres-pv