host_path deleter only supports /tmp/.+ but received provided /mnt/disk/kafka

9/30/2019

I am trying to delete a persistent volume, to start form scratch a used kafka cluster into kubernetes, i changed the Retain mode to Delete, it was Retain. But i am not able to delete two of the three volumes:

[yo@machine kafka_k8]$ kubectl describe pv kafka-zk-pv-0
  Name:           kafka-zk-pv-0
  Labels:         type=local
  StorageClass:
  Status:         Failed
  Claim:          kafka-ns/datadir-0-poc-cp-kafka-0
  Reclaim Policy: Delete
  Access Modes:   RWO
  Capacity:       500Gi
  Message:        host_path deleter only supports /tmp/.+ but received provided /mnt/disk/kafka
  Source:
         Type:       HostPath (bare host directory volume)
         Path:       /mnt/disk/kafka
  Events:
        {persistentvolume-controller }                  Warning         
        VolumeFailedDelete      host_path deleter only supports /tmp/.+ but received provided /mnt/disk/kafka
-- jacktrade
kubernetes

1 Answer

9/30/2019

i changed to retain to "Recycle" and the volume now is able to be recreated.

kubectl patch pv kafka-zk-pv-0 -p '{"spec"{"persistentVolumeReclaimPolicy":"Recycle"}}'
-- jacktrade
Source: StackOverflow