<p>It seems like, While deleting the pv,pvc, I have messed up. I can delete the pvc without issues but I can not delete the pv that pv-protection in it. while deleting pv,pvc earlier, I have pressed CTRL+C since it was taking time to delete it and also deleted the storageclass before deleting the pvc. I don't remember the storage class that was used for creating the pvc.</p>

<p>In this <a href="https://stackoverflow.com/questions/51358856/kubernetes-cant-delete-persistentvolumeclaim-pvc">post</a>, it says, updating the pvc protection to null will help remove the pvc. But I had to delete the pv which has pv-protection. The below is the describe output of pv.</p>

<pre><code>~/github/vault-operator# kubectl describe pv pv-hostpath
Name:            pv-hostpath
Labels:          type=local
Annotations:     pv.kubernetes.io/bound-by-controller: yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    manual
Status:          Terminating (lasts &lt;invalid&gt;)
Claim:           poc-namespace/pvc-hostpath
Reclaim Policy:  Retain
Access Modes:    RWO
Capacity:        1Gi
Node Affinity:   &lt;none&gt;
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /kube
    HostPathType:  
Events:            &lt;none&gt;

~/github/vault-operator# kubectl get pv,pvc
NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                            STORAGECLASS   REASON   AGE
persistentvolume/pv-hostpath   1Gi        RWO            Retain           Terminating   poc-namespace/pvc-hostpath   manual                  11d
</code></pre>

<p>question is, how can i delete the pv that is not deleted properly and what could be my issue.</p>

intechops6
<p>In this scenario, you have a PVC (poc-namespace/pvc-hostpath) that is preventing your PV from being deleted. Delte the PVC, and you can delete the PV.</p>

<p>Generally speaking, the <code>Reclaim Policy</code> of a PVC is <code>delete</code>, by default, so when you delete a PVC, it automatically deletes the PV bound to it. </p>

<p>Your <code>storageClass</code> probably was <a href="https://github.com/rancher/local-path-provisioner" rel="nofollow noreferrer">this</a> one (or similar), from rancher. It is a <code>hostPath</code> based one, meaning it maps your container volume to the host machine.</p>
