Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable minikube mount for kic drivers (docker, podman) #6628

Closed
medyagh opened this issue Feb 13, 2020 · 10 comments · Fixed by #6630
Closed

enable minikube mount for kic drivers (docker, podman) #6628

medyagh opened this issue Feb 13, 2020 · 10 comments · Fixed by #6630
Assignees
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature.

Comments

@medyagh
Copy link
Member

medyagh commented Feb 13, 2020

No description provided.

@medyagh medyagh changed the title add mount for kic drivers (docker, podman) enable minikube mount for kic drivers (docker, podman) Feb 13, 2020
@medyagh medyagh self-assigned this Feb 13, 2020
@medyagh medyagh added co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. labels Feb 13, 2020
@medyagh
Copy link
Member Author

medyagh commented Feb 13, 2020

on linux this works

docker@p2:~$ /sbin/ip route|awk '/default/ { print $3 }'

also

docker inspect --format '{{(index .IPAM.Config 0).Gateway}}' $(docker network ls --filter name=bridge --format {{.ID}})

@medyagh
Copy link
Member Author

medyagh commented Feb 14, 2020

dig +short host.docker.internal

@medyagh
Copy link
Member Author

medyagh commented Feb 15, 2020

update for mount on Mac I get the IP using ( 'dig +short host.docker.internal')

it keeps telling me
"special device 192.168.65.2 does not exist."

to debug and confirm the problem is not connectivity I started a UFS server manually with this code

	p, err := getPort()
	if err != nil {
		fmt.Printf("Failed to get port: %v", err)
	}
	fmt.Println(p)
	ufs.StartServer(net.JoinHostPort("0.0.0.0", strconv.Itoa(p)), 8, "/Users/medmac/minikube/tmp13")

then inside container I tried the command that minikube is running which is

root@minikube:/# mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=56172,version=9p2000.L 192.168.65.2 /m13
mount: /m13: special device 192.168.65.2 does not exist.

(I get the IP using 'dig +short host.docker.internal')
I ran the same command and I change the port to the one I have :

and exact same error, however I am able to curl the ip from inside the container and on the server I see the response :

root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server
root@minikube:/# curl 192.168.65.2:56172
curl: (52) Empty reply from server

same as dns

root@minikube:/# curl host.docker.internal:56172
curl: (52) Empty reply from server
root@minikube:/# curl host.docker.internal:56172
curl: (52) Empty reply from server
root@minikube:/# curl host.docker.internal:56172
curl: (52) Empty reply from server
root@minikube:/# curl host.docker.internal:56172
curl: (52) Empty reply from server
root@minikube:/#
root@minikube:/# curl host.docker.internal:56172
curl: (52) Empty reply from server

however the mount command insider the cntainer special device doesn't exists and on the server side I see no evidance that it receives the request at all

root@minikube:/# mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=56172,version=9p2000.L 192.168.65.2 /m13
mount: /m13: special device 192.168.65.2 does not exist.
root@minikube:/#
root@minikube:/# mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=56172,version=9p2000.L host.docker.internal /m13
mount: /m13: special device host.docker.internal does not exist.

any idea @afbjorklund
@tstromberg @josedonizetti

@medyagh
Copy link
Member Author

medyagh commented Feb 15, 2020

one difference I could think of with VM is,
the mount version is different by one patch
version on the container:

mount --version
mount from util-linux 2.34 (libmount 2.34.0: selinux, smack, btrfs, namespaces, assert, debug)

@afbjorklund
Copy link
Collaborator

Seem to be missing a colon : after the IP, in the mount command ?

@medyagh
Copy link
Member Author

medyagh commented Feb 16, 2020

@afbjorklund

Seem to be missing a colon : after the IP, in the mount command ?

the command is same command is used in VM. this PR only changed what IP would return.... where would the : be ?

@tstromberg tstromberg added this to the v1.8.0 Feb 28 milestone Feb 19, 2020
@tstromberg
Copy link
Contributor

tstromberg commented Feb 19, 2020

@medyagh - To me, the error message indicates a parse error. Try running the embedded shell script commands to see which is failing:

  • grep ^docker: /etc/group
  • id -u docker

@tstromberg
Copy link
Contributor

My suggestion would be to use $SUDO_UID and $SUDO_GID instead of those shell lookups.

@tstromberg
Copy link
Contributor

Looks like a red herring. Those subcommands work just fine, but for whatever reason, the mount command is still failing. Is it a privilege thing, or a quirk of the Docker VM? I don't know.

That said, I can confirm that the Docker container can exchange packets to the 9p filesystem just fine:

# echo test | nc -vv 192.168.65.2 59542
192.168.65.2: inverse host lookup failed: Unknown host
(UNKNOWN) [192.168.65.2] 59542 (?) open
 sent 5, rcvd 0

The error message seems to be unrelated to connectivity. straces shows:

access("/run/mount", R_OK|W_OK)         = 0
mount("192.168.65.2", "/mount-9p", "9p", 0, "dfltgid=110,dfltuid=1000,msize=2"...) = -1 ENOENT (No such file or directory)
lstat("/mount-9p", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/mount-9p", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("192.168.65.2", 0x7fffa0f4e9a0)    = -1 ENOENT (No such file or directory)
write(2, "mount: ", 7mount: )                  = 7
write(2, "/mount-9p: special device 192.16"..., 54/mount-9p: special device 192.168.65.2 does not exist.) = 54
write(2, "\n", 1
)                     

It's still unclear to me why it's looking for the argument to contain local device rather than passing it to the 9p driver as an IP.

@tstromberg
Copy link
Contributor

Seen in dmesg:

[ 631.443997] 9pnet_virtio: no channels available for device 192.168.65.2

Woops, mount -9p on the Docker VM defaults to VirtIO instead of TCP for it's transmission method. Easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants