<p>I am using <code>kubectl apply -f pv.yaml</code> on this basic setup:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume 
metadata:
  name: pv-demo
spec:
  storageClassName: "normal"
  capacity:
    storage: 1Gi
  persistentVolumeReclaimPolicy: Delete
  accessModes: 
  - ReadWriteOnce
  hostPath:
    path: /home/demo/
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-demo
spec:
  storageClassName: "normal"
  resources:
    requests:
      storage: 200Mi
  accessModes:
  - ReadWriteOnce
---
apiVersion: v1
kind: Pod
metadata:
  name: nginx-demo
  labels:
    name: nginx-demo
spec:
  containers:
  - image: nginx
    name: nginx
    volumeMounts:
    - mountPath: /usr/share/nginx/html
      name: pv-demo
  volumes:
  - name: pv-demo
    persistentVolumeClaim:
      claimName: pvc-demo 
</code></pre>

<p>Now I wanted to delete everything so I used: <code>kubectl delete -f pv.yaml</code>
However, the volume still persists on the node at /home/demo and has to be removed manually.</p>

<p>So I tried to patch and remove protection before deletion: </p>

<pre><code>kubectl patch pv pv-demo -p '{"metadata":{"finalizers":null}}'
</code></pre>

<p>But the mount still persists on the node.
I tried to edit and null Finalizers manually, although it said 'edited'; <code>kubectl get pv</code> shows Finalizers unmodified.</p>

<p>I don't understand what's going on, Why all of the above is not working? I want when delete, the mount folder on the node /home/demo gets deleted as well.</p>

x300n
<p>This is expected behavior when using  <code>hostPath</code>  as it does not support deletion as to other volume types. I tested this with <code>kubeadm</code> and <code>gke</code> clusters and the mounted directory and files remain intact after removal the <code>pv</code> and <code>pvc</code>. </p>

<p>Taken from the manual about reclaim policies:</p>

<blockquote>
  <p>Currently, only NFS and HostPath support recycling. AWS EBS, GCE PD,<br>
  Azure Disk, and Cinder volumes support deletion.</p>
</blockquote>

<p>While <code>recycle</code> is mentioned  in <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#recycle" rel="nofollow noreferrer">documentation</a> as deprecated <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.5.md#deprecations" rel="nofollow noreferrer">since version 1.5</a> it still works and can cleanup your files but it won`t delete your mounted directory. It is not ideal but that is the closest workaround. </p>

<p>IMPORTANT: 
To successfully use recycle you cannot delete PV itself. If you delete PVC then controller manager creates recycyler pod that cleans up the volumes and this volume become available for binding to the next PVC. </p>

<p>When looking at the control-manager logs you can see that <code>host_path deleter</code> rejects the <code>/home/demo/</code> dir deletion and it supports only deletion of the <code>/tmp/.+</code> directory. However after testing this <code>tmp</code> is also not being deleted. </p>

<pre><code>'Warning' reason: 'VolumeFailedDelete' host_path deleter only supports /tmp/.+ but received provided /home/demo/```
</code></pre>
