I have a use case where I need a Docker container under kubernetes to access a hostPath. I'm using minikube, and the container is able to access a folder in the minikube VirtualBox VM. But I can't figure out how to get it to access a folder on the host itself.
I do these commands on the host to create /opt/foo for sharing in the VM:
$ sudo touch /opt/foo/FOO
$ ls /opt/foo
FOO
$ minikube mount -v 5 /opt/foo:/opt/foo
Mounting /opt/foo into /opt/foo on the minikubeVM
This daemon process needs to stay alive for the mount to still be accessible...
ufs starting
In another window I look in the minikube VM
$ minikube ssh -- sudo ls -la /opt/foo
total 0
drwxrwxr-x 2 root root 0 Jun 1 14:44 .
drwxr-xr-x 5 root root 0 Jun 1 14:44 ..
Is there another step needed to make the files in that directory accessible?
FYI - use case is a container process creating files that a host process is harvesting. Thus I do not want to use nfs or PersistentVolumes. Host is Centos7. minikube version: v0.19.0.