kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.41k stars 4.88k forks source link

minikube mount not properly synchronized with host #2379

Closed jjbooth74 closed 6 years ago

jjbooth74 commented 6 years ago

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug Report

Please provide the following details:

Environment:

What happened:

Following this guide: https://github.com/kubernetes/minikube/blob/master/docs/host_folder_mount.md

The directory's contents are not properly mounted:

Terminal 1:

$ mkdir ~/fruits
$ cd ~/fruits
$ touch host
$ minikube mount ~/fruits:/fruits
Mounting /Users/jbooth-mac/fruits into /fruits on the minikube VM
This daemon process needs to stay alive for the mount to still be accessible...
ufs starting

Terminal 2:

$ minikube ssh
(vm)$ cd /fruits
(vm)$ ls -al
total 0
drwxrwxr-x  2 root root 0 Jan  2 21:04 .
drwxr-xr-x 20 root root 0 Jan  2 21:04 ..
(vm)$ touch vm
touch: cannot touch 'vm': Permission denied
(vm)$ sudo touch vm
(vm)$ ls
vm
(vm)$ exit
logout

$ ls
host

As you can see, it properly creates the /fruits directory, but it does not appear to sync between host and VM.

What you expected to happen: I expect /fruits on the VM to see the changes in ~/fruits on the host.

How to reproduce it (as minimally and precisely as possible): See above.

Output of minikube logs (if applicable):

Anything else do we need to know: fruits is obviously contrived, the goal is to synchronize my GOPATH from host all the way through to a docker container inside minikube.

RoBorg commented 6 years ago

Maybe see #2529 - it could be failing silently. Try running minikube mount -v10 ~/fruits:/fruits instead.

jjbooth74 commented 6 years ago
[I] ➜ minikube mount -v10 "$HOME/fruits":/fruits
Mounting /Users/jbooth-mac/fruits into /fruits on the minikube VM
This daemon process needs to stay alive for the mount to still be accessible...
ufs starting
Using SSH client type: native
&{{{<nil> 0 [] [] []} docker [0x1437740] 0x14376f0  [] 0s} 127.0.0.1 60155 <nil> <nil>}
About to run SSH command:
sudo umount /fruits;
SSH cmd err, output: Process exited with status 32: umount: /fruits: mountpoint not found

Using SSH client type: native
&{{{<nil> 0 [] [] []} docker [0x1437740] 0x14376f0  [] 0s} 127.0.0.1 60155 <nil> <nil>}
About to run SSH command:

sudo mkdir -p /fruits || true;
sudo mount -t 9p -o trans=tcp,port=56482,dfltuid=1001,dfltgid=1001,version=9p2000.u,msize=262144 192.168.99.1 /fruits;
sudo chmod 775 /fruits;

and there it hangs for a long time until:

SSH cmd err, output: <nil>: mount: mount 192.168.99.1 on /fruits failed: Connection timed out

So it would appear that there is a connectivity issue between my VM and host.

jjbooth74 commented 6 years ago

These two issues: #1548 and #1223 pointed me in the right direction.

Looks like my corporate overlords enabled a firewall and that's what's blocking the mount from going through.