cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
name: host-path-pv
namespace: skobba
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /Volumes/Data
storageClassName: ""
EOF
Ref.: https://www.linkedin.com/pulse/why-pv-persistent-volume-pvc-claim-get-stuck-state-due-nguyen-duc/
Even though the PV appears in Terminating status, its actual status is still Bound, the finalizer relies on deletionTimestamp and deletionGracePeriodSeconds fields inside metadata to fulfill its purpose.
View terminating status:
kubectl get pv
To remove a finalizer from a PVC, use the following command as an example:
kubectl patch pvc pv-claim-name -p '{"metadata":{"finalizers":null}}'