kubernetes-retired/kubeadm-dind-cluster

Where the DinD container gateway is present?

ervikrant06 opened this issue · 1 comments

Started the cluster on Mac using the script. After that spawned one POD and I was able to ping the external world from POD. I found this default route 10.192.0.1 on DinD container. I am not able to trace where this GW is present. I checked the Mac ifconfig -abut didn't find any interface with this IP address. I know this is not an issue but I really didn't find any information about it. Can anyone please help me to locate the gateway?

docker exec -it c0649881dc55 ip route list
default via 10.192.0.1 dev eth0
10.192.0.0/24 dev eth0 proto kernel scope link src 10.192.0.3
10.244.1.0/24 via 10.192.0.2 dev eth0
10.244.2.0/24 dev dind0 proto kernel scope link src 10.244.2.1
10.244.3.0/24 via 10.192.0.4 dev eth0
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown

The problem is that Mac Docker networking is a bit ... complicated.
10.192.0.1 is handled by Docker. On Mac, Docker runs inside a VM. You can attach to the VM's console like this:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

or using nsenter (which may be better as screen may have some glitches in this case)

docker run --privileged --pid=host -it --rm ubuntu nsenter -t 1 -m -u -i -n -p /bin/sh

From there, you can look at the IPs:

ivan4th@i4mac:~$ docker run --privileged --pid=host -it --rm ubuntu nsenter -t 1 -m -u -i -n -p /bin/sh
/ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 02:50:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.65.3/24 brd 192.168.65.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::50:ff:fe00:1/64 scope link
       valid_lft forever preferred_lft forever
3: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN qlen 1
    link/ipip 0.0.0.0 brd 0.0.0.0
4: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN qlen 1
    link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:71:85:e8:eb brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:71ff:fe85:e8eb/64 scope link
       valid_lft forever preferred_lft forever
7: vethade6910@if6: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master docker0 state UP
    link/ether 8a:0b:d1:76:7b:61 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::880b:d1ff:fe76:7b61/64 scope link
       valid_lft forever preferred_lft forever
22: br-30df74444e52: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:f5:15:51:0a brd ff:ff:ff:ff:ff:ff
    inet 10.192.0.1/24 brd 10.192.0.255 scope global br-30df74444e52
       valid_lft forever preferred_lft forever
    inet6 fe80::42:f5ff:fe15:510a/64 scope link
       valid_lft forever preferred_lft forever
24: veth0c3faa6@if23: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master br-30df74444e52 state UP
    link/ether 4a:be:71:27:c7:80 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::48be:71ff:fe27:c780/64 scope link
       valid_lft forever preferred_lft forever
26: vetha3dafe0@if25: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master br-30df74444e52 state UP
    link/ether c6:8a:18:5f:b1:11 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c48a:18ff:fe5f:b111/64 scope link
       valid_lft forever preferred_lft forever
28: vethb54a313@if27: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master br-30df74444e52 state UP
    link/ether a6:a9:80:cb:d3:95 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a4a9:80ff:fecb:d395/64 scope link
       valid_lft forever preferred_lft forever
30: veth6b83276@if29: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master docker0 state UP
    link/ether d6:bc:6c:27:70:c7 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::d4bc:6cff:fe27:70c7/64 scope link tentative
       valid_lft forever preferred_lft forever

As you can see, br-30df74444e52 inside the docker's VM has this 10.192.0.1/24 address.