How do you delete Minikube hostpath directory from host using xhyve?

1/5/2017

I'm using the PersistentVolume functionality for sharing VM directories with Pods. For example:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: psql-data-disk
spec:
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 1Gi
  hostPath:
    path: /data/psqldata

But I can't figure out how to delete the directory from the host VM so that I can reset the data. Minikube persists the /data/ directory across VM reboots, but doesn't document where it's storing it.

If you kubectl delete PersistentVolume psql-data-disk it doesn't delete any of the contents in the directory itself, it just deletes the K8s resource.

I'm using the docker-machine-driver-xhyve driver installed via brew on OSX Sierra.

-- Shane
kubernetes
macos
minikube

1 Answer

1/5/2017

Ugh, I hadn't known about the minikube ssh command to get into the VM. So I just went in there and deleted the directory.

-- Shane
Source: StackOverflow