kid icon indicating copy to clipboard operation
kid copied to clipboard

The path /var/lib/kubelet/ is not shared

Open nem75 opened this issue 8 years ago • 22 comments

Running OS X El Capitan && Docker for Mac 1.12.

Upon ./kid up I always get

Docker for Mac detected
docker: Error response from daemon: Mounts denied:
The path /var/lib/kubelet/
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
..
Waiting for Kubernetes cluster to become available...

until I SIGINT.

But in the "File Sharing" tab in Docker for Mac preferences the directory /private is already set and /var in OS X is a symlink to /private/var, so whatever kid needs in there should be shared already.

$ ls -l /
...
lrwxr-xr-x@  1 root  wheel    11 Mar 12 10:38 var -> private/var

Adding the subdirectory kubelet did not help. Adding the path /var/lib/kubelet to the File Sharing preferences is not possible since it resolves to /private/var/lib/kubelet (because of the symlink) and then overlaps with the /private share:

screen shot 2016-08-03 at 20 59 49

What to do?

nem75 avatar Aug 03 '16 19:08 nem75

Seems this is a general Docker for OSX issue. Any pointers welcome though, after an hour of googling and reading I'm still at a loss.

nem75 avatar Aug 03 '16 19:08 nem75

I have similar problems. I have changed the paths for the volume mounting for the kublet docker container in the kid script to find both the kublet and docker locations.
I get a bit further but it does not find the docker daemon.

-        --volume=/var/lib/docker/:/var/lib/docker:rw \
-        --volume=/var/lib/kubelet/:/var/lib/kubelet:rw,shared \
+        --volume="/Users/YOUR_USER/Library/Group Containers/group.com.docker/bin/docker":/var/lib/docker:rw \
+        --volume=/private/var/lib/kubelet:/var/lib/kubelet:rw,shared \

onekilo79 avatar Aug 04 '16 08:08 onekilo79

Changing the path in the kid script to

+        --volume=/private/var/lib/kubelet/:/var/lib/kubelet:rw,shared \

and creating that directory with permissions 777 makes the "is not shared" error go away.

But then I get

$ ./kid up
Docker for Mac detected
docker: Error response from daemon: mkdir /private: file exists.
Waiting for Kubernetes cluster to become available...

and that's it.

@onekilo79 do you have Docker for Mac installed (not the old Docker Toolbox)? If not, try it. Also what your tried above, mapping the docker binary to /var/lib/docker in the Moby VM, cannot be right.

nem75 avatar Aug 04 '16 10:08 nem75

I tried both. I never got this project to start with anything.

I also never got the minikube with a running k8s app either.

onekilo79 avatar Aug 04 '16 10:08 onekilo79

I did get a minikube 0.7.1 session up and running using mac non-beta client 1.12.1 and using the dvm Docker version manager to downgrade docker client to 1.11.1. Do not use the docker-env settings from minikube.

onekilo79 avatar Aug 10 '16 18:08 onekilo79

Ah, running into this, too. Shoot.

jmhodges avatar Aug 13 '16 07:08 jmhodges

Changed host path to /private/var/lib/kubelet as suggested by @nem75 but getting the somewhat cryptic error:

docker: Error response from daemon: linux mounts: Path /private/var/lib/kubelet is mounted on /private but it is not a shared mount..

solsson avatar Aug 18 '16 05:08 solsson

I am getting this issue as well, with current master (ie, post #15 as it's at 1.3.5 now)

brianm avatar Sep 02 '16 20:09 brianm

I'd call this really a docker bug, fwiw, that it de-references symlinks, but :-/

brianm avatar Sep 02 '16 20:09 brianm

+1 Having the same issue any luck with this?

mamluka avatar Sep 03 '16 14:09 mamluka

same here +1

Lifang13 avatar Sep 30 '16 00:09 Lifang13

+1 to this issue. targeting /var/log since the containers should also be compatible with gnu/linux distributions - but ofcourse, osx's /var is just a symlink.

nmcalabroso avatar Nov 01 '16 18:11 nmcalabroso

+1

I'm also experiencing this issue on macOS Sierra.

simongui avatar Nov 22 '16 04:11 simongui

I have the exact same issue using /var/www

esetnik avatar Dec 12 '16 20:12 esetnik

Did anyone find some solution to this ?

arlindiDev avatar Jan 09 '17 13:01 arlindiDev

I've revert to using minikube due to this issue.

dkapanidis avatar Jan 09 '17 14:01 dkapanidis

I fixed the issue by editing the ./docker-compose.yml file. I changed the /var/whatever:/var/whatever to /private/var/whatever:/var/whatever

arlindiDev avatar Jan 09 '17 14:01 arlindiDev

注释掉Mountflag就好了

chinakevinguo avatar Aug 16 '17 08:08 chinakevinguo

+1

BWStearns avatar Aug 18 '17 15:08 BWStearns

+1

d0u9 avatar Oct 30 '17 02:10 d0u9

+1

antonio-one avatar Nov 25 '17 19:11 antonio-one

+1

ghost avatar Apr 19 '18 20:04 ghost