Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Debugging Kubernetes network
core@pc-10368 ~ $ ifconfig cbr0
cbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::d8c5:1fff:fe59:42ff prefixlen 64 scopeid 0x20<link>
ether da:c5:1f:59:42:ff txqueuelen 0 (Ethernet)
RX packets 71 bytes 5132 (5.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 326 bytes 17297 (16.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=docker.socket early-docker.target network.target setup-network-environment.service
Requires=docker.socket early-docker.target setup-network-environment.service
[Service]
Environment=TMPDIR=/var/tmp
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
ExecStart=/usr/lib/coreos/dockerd --daemon --host=fd:// --bridge=cbr0 --iptables=false --ip-masq=false
[Install]
WantedBy=multi-user.target
[
{
"Id": "0f529141a9eaa03cdf6975f276a5e762192c11e54345138e85fc0a767887e7c2",
"Created": "2015-09-19T13:45:39.919158297Z",
"Path": "/pause",
"Args": [],
"State": {
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 7590,
"ExitCode": 0,
"Error": "",
"StartedAt": "2015-09-19T13:45:39.994509711Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "2c40b0526b6358710fd09e7b8c022429268cc61703b4777e528ac9d469a07ca1",
"NetworkSettings": {
"Bridge": "cbr0",
"EndpointID": "2e821b000c923e52acac71c6c9bde2f9b9fef494be1acc2388824550065227af",
"Gateway": "192.168.1.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"HairpinMode": false,
"IPAddress": "192.168.1.9",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"MacAddress": "02:42:c0:a8:01:09",
"NetworkID": "d2a943b06502cde2dc63542eb5762b7b3f1e85cf4a8fbac6c155d768eab67883",
"PortMapping": null,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/0f529141a9ea",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
},
"ResolvConfPath": "/var/lib/docker/containers/0f529141a9eaa03cdf6975f276a5e762192c11e54345138e85fc0a767887e7c2/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/0f529141a9eaa03cdf6975f276a5e762192c11e54345138e85fc0a767887e7c2/hostname",
"HostsPath": "/var/lib/docker/containers/0f529141a9eaa03cdf6975f276a5e762192c11e54345138e85fc0a767887e7c2/hosts",
"LogPath": "/var/lib/docker/containers/0f529141a9eaa03cdf6975f276a5e762192c11e54345138e85fc0a767887e7c2/0f529141a9eaa03cdf6975f276a5
e762192c11e54345138e85fc0a767887e7c2-json.log",
"Name": "/k8s_POD.3ef3f8d9_test-v2-mrq5i_default_b6e1261c-5ed4-11e5-9986-f0def1460b1c_92661fed",
"RestartCount": 0,
"Driver": "overlay",
"ExecDriver": "native-0.2",
"MountLabel": "",
"ProcessLabel": "",
"Volumes": {},
"VolumesRW": {},
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LxcConf": null,
"Memory": 0,
"MemorySwap": -1,
"CpuShares": 2,
"CpuPeriod": 0,
"CpusetCpus": "",
"CpusetMems": "",
"CpuQuota": 0,
"BlkioWeight": 0,
"OomKillDisable": false,
"Privileged": false,
"PortBindings": null,
"Links": null,
"PublishAllPorts": false,
"Dns": [
"129.132.98.12"
],
"DnsSearch": [
"ethz.ch"
],
"ExtraHosts": null,
"VolumesFrom": null,
"Devices": null,
"NetworkMode": "bridge",
"IpcMode": "",
"PidMode": "",
"UTSMode": "",
"CapAdd": null,
"CapDrop": null,
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"SecurityOpt": null,
"ReadonlyRootfs": false,
"Ulimits": null,
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"CgroupParent": ""
},
"Config": {
"Hostname": "test-v2-mrq5i",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": null,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"KUBERNETES_PORT_443_TCP_ADDR=10.100.0.1",
"KUBERNETES_SERVICE_HOST=10.100.0.1",
"KUBERNETES_SERVICE_PORT=443",
"KUBERNETES_PORT=tcp://10.100.0.1:443",
"KUBERNETES_PORT_443_TCP=tcp://10.100.0.1:443",
"KUBERNETES_PORT_443_TCP_PROTO=tcp",
"KUBERNETES_PORT_443_TCP_PORT=443",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": null,
"Image": "gcr.io/google_containers/pause:0.8.0",
"Volumes": null,
"VolumeDriver": "",
"WorkingDir": "",
"Entrypoint": [
"/pause"
],
"NetworkDisabled": false,
"MacAddress": "",
"OnBuild": null,
"Labels": {
"io.kubernetes.pod.name": "default/test-v2-mrq5i",
"io.kubernetes.pod.terminationGracePeriod": "30"
}
}
}
]
core@pc-10368 ~ $ docker exec -ti 3b6 /bin/bash
root@test-0ocfk:/# ping -c 1 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sending packet: Network is unreachable
root@test-0ocfk:/# ping -c 1 192.168.1.6
PING 192.168.1.6 (192.168.1.6): 56 data bytes
ping: sending packet: Network is unreachable
root@test-0ocfk:/# ping -c 1 www.google.com
ping: unknown host
root@test-0ocfk:/# ifconfig
bash: ifconfig: command not found
root@test-0ocfk:/# exit
core@pc-10368 ~ $
core@pc-10368 ~ $ docker run -ti ubuntu
root@5159bdfd3d36:/# ping -c 1 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.053 ms
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.053/0.053/0.053/0.000 ms
root@5159bdfd3d36:/# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:c0:a8:01:08
inet addr:192.168.1.8 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::42:c0ff:fea8:108/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2300 (2.3 KB) TX bytes:898 (898.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@5159bdfd3d36:/# ping -c 1 www.google.com
PING www.google.com (173.194.40.82) 56(84) bytes of data.
64 bytes from zrh04s06-in-f18.1e100.net (173.194.40.82): icmp_seq=1 ttl=52 time=1.09 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.098/1.098/1.098/0.000 ms
root@5159bdfd3d36:/#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.