jianz / k8s-reset-terminating-pv

Reset persistent volume status from terminating back to bound.
MIT License
107 stars 29 forks source link

+ Added Support for PVC recovering #7

Open flexarts opened 7 months ago

flexarts commented 7 months ago

I had the problem that i created a PVC with auto-provisioning of a PV for a deployment. Then I accidentally deleted the PVC but the finalizer protected the PVC (and underlaying PV) from being deleted right away.

To use the new PVC Recover functionality one must supply the PVC Name (prefixed by the K8s namespace) and the flag --mode set to pvc, e.g.

resetpv --mode pvc --etcd-ca ca.crt --etcd-cert etcd.crt --etcd-key etcd.key default/testpvc