Docker Community Forums

Share and learn in the Docker community.

The reason binding VIP on container while usging IPVS nat mode in docker dwarm mode

docker

(Zhang Xiangjun) #1

I see that IPVS is running in nat mode:

nsenter --net=/var/run/docker/netns/b428ed7936f2 ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
FWM 266 rr
-> 10.255.0.7:0 Masq 1 0 0

But I also see that the VIP is binded on container interface:

root@2f348f97511f:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
174: eth0@if175: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default
link/ether 02:42:0a:ff:00:07 brd ff:ff:ff:ff:ff:ff
inet 10.255.0.7/16 scope global eth0
valid_lft forever preferred_lft forever
inet 10.255.0.4/32 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::42:aff:feff:7/64 scope link
valid_lft forever preferred_lft forever
176: eth1@if177: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:12:00:03 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.3/16 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::42:acff:fe12:3/64 scope link
valid_lft forever preferred_lft forever

What’s the reason for binding VIP?