All my containers cannot access internet if run without '--net=host'.
Ubuntu 13.04
1.6.2
go1.4.2
DEFAULT_FORWARD_POLICY="ACCEPT"
2375/tcp ALLOW Anywhere
docker -d -H unix:///var/run/docker.sock --bip=172.17.42.1/16 -b docker0
docker0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN
I can append --net=host
manually, but kubernetes always runs the docker without it. So any dockers in pods cannot pull images. What's worse, the Guestbook example failed either with the error connection refused
, even add x.x.x.x redis-master
in /etc/hosts
of slaves.
So is there a way to use host mode as docker daemon arg, or the kube arg?
Kubernetes allows you to enable host networking on a per-pod basis. See the configuration for the Kubernetes apiserver for an example of where in the yaml config you should specify "hostNetwork": true
.