-
Notifications
You must be signed in to change notification settings - Fork 881
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
Docker 18.03.1-ce routing mesh not working #2227
Comments
@giMini can you try: |
@fcrisciani here the result $curl -v -4 http://localhost
|
@giminni does it work if you do curl inside the container? |
@fcrisciani If I use the docker_gwbridge ip address of the container 172.18.0.3 not 172.18.0.2 it works, I guess something is wrong with the ingress_sbox container or iptables configuration. $ docker network inspect docker_gwbridge $curl -v -4 http://172.18.0.3
< HTTP/1.1 200 OK |
@fcrisciani I can access the vip address from the ingress_sbox shell Chain INPUT (policy ACCEPT 154 packets, 17089 bytes) Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 174 packets, 13945 bytes) Chain POSTROUTING (policy ACCEPT 174 packets, 13945 bytes) |
from the host it matches the DOCKER_INGRESS
and that direct it to the ingress namespace:
Now as the packets pass through the ingress_sbox they are getting marked:
and then IPVS is load balancing them to the backend container:
Did something changed between your new analysis and the support.sh? I can see that from the support the backend is |
@fcrisciani Why are the packet counter zero in DOCKER-INGRESS and POST-ROUTING? I will upload an updated docker-support log this morning and reset the packet counter. BTW is there an issue using kernel 4.4 and iptables 1.6.1? |
@fcrisciani I looked inside the ingress sandbox, the counters are always zero Here my findings: # iptables -vnL -t nat Chain INPUT (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) Chain DOCKER_OUTPUT (1 references) Chain DOCKER_POSTROUTING (1 references) # iptables -vnL -t mangle Chain INPUT (policy ACCEPT 0 packets, 0 bytes) Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) And the endpoint is never reached. |
@giminni the default gw network is mainly for north/south communication than for exposing services. |
I use w3m http://localhost trying to reach port 80
Looking at DOCKER-INGRESS chain got counts on RETURN not for port 80
Going now to ingress sandbox on table mangle I see activity on all chains, but packet counter for port 80 is zero.
Showing the stats inside the sandbox I can't see any activity
|
@giminni I tried the steps that you mentioned at the top on an x86, ubuntu 18.04 instance but I'm not able to reproduce with a vanilla nginx instance, and debugging iptables from github is really tedious. |
@fcrisciani thx for instruction Can this be a problem with kernel 4.4? and can you show me a working iptables -vnL -t nat on the host and iptables -vnL -t mangle on ingress_sbox? I am testing using hping3 localhost -p 80 on the host and tcpdump -i eth1 on ingress_sbox. In parallel I use watch -n 2 -d iptables -vnL -t nat without success UPDATE: If I sent a SYN flag using hping3 -V -S -p 80 localhost it works and the counters are incremented, seeing traffic on eth1 on ingress_sbox. Why can SYN pass through? |
@giminni ingress is exposing TCP ports, ICMP is not going to work. This is the tool to get the output: Test:
|
@fcrisciani I am not using ping I use hping3
on ingress_sbox I got:
and I see that SYN is working, but not HTTP |
@fcrisciani
|
@giminni do you have any overlap between your host interfaces and the container network? |
@fcrisciani No overlap BTW I have no firewall service running and I am using kernel 4.4.x and my docker environment is running with the --experimental flag (see above), can this be a show stopper? |
@fcrisciani looking around what could be the root cause, can it be that some mandatory netfilter kernel module are missing? Here my findings:
|
@fcrisciani I got it running using endpoint-mode dnsrr and --publish mode=host,published=80,target=80 Now why is it not running in endpoint-mode vip?? Still thinking of missing kernel stuff Alternative would be to install an external load balancer if vip is not working properly |
@giminni it is running because you are using mode=host, so there is no ingress being used, the service will be accessible only on that node and not from the rest of the cluster. |
@fcrisciani Here my ifconfig
docker_gwbridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 veth1f20832: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 veth37a5581: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 |
@fcrisciani Thx for support. |
@giminni I was hoping you could share the modules you were missing. I have a very similar board (pine64 vs your rock64) and I am seeing the exact problems you are. I am trying to find where I can compare kernel modules to find missing ones but I have running into issues. |
Same situation here... @giminni any chance you share what you did? |
I ended up getting it working using an Armbian build that contained the correct modules. This goes for both Docker Swarm and Kubernetes. Here is my write up on it (comments at bottom) |
Hi @tylerwight thanks, yeah, I saw your workaround too. In fact, I just finished flashing and I am now gonna try to install Docker. This is the image I downloaded and I am running on a Rock64 |
Ok... @tylerwight I can confirm it also works for me with Armbian!!! Thank you very much for your workaround. |
hi @giminni , |
FYI. I have exact problem and have managed to fix the issue by finding the missing modules and recompile/enable them in kernel:
chmod 0755 check-config.sh
|
@hueyvle which modules were you missing and which did you have to recompile to get this working please? I have the same problem in the OP, and I am missing the following in Network Drivers: Latest vanilla Raspbian, same local switch between swarm nodes, all nodes listening on port 4789, 2377 and 7946, no host firewall enabled. Still unable to access containers except directly pointed to the host it's running on - pulling my hair out! |
Points out another symbol that Docker might need. in this case Docker's mesh network in swarm mode does not route Virtual IPs if it's unset. From /var/logs/docker.log: time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]: (iptables failed: iptables --wait -t mang le -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))" Bug: moby/libnetwork#2227 Bug: docker/for-linux#644 Bug: docker/for-linux#525 Signed-off-by: Piotr Karbowski <[email protected]>
Points out another symbol that Docker might need. in this case Docker's mesh network in swarm mode does not route Virtual IPs if it's unset. From /var/logs/docker.log: time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]: (iptables failed: iptables --wait -t mang le -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))" Bug: moby/libnetwork#2227 Bug: docker/for-linux#644 Bug: docker/for-linux#525 Signed-off-by: Piotr Karbowski <[email protected]> Upstream-commit: e8ceb976469e15547ed368ba5c110102ccc5fbfa Component: engine
Points out another symbol that Docker might need. in this case Docker's mesh network in swarm mode does not route Virtual IPs if it's unset. From /var/logs/docker.log: time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]: (iptables failed: iptables --wait -t mang le -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))" Bug: moby/libnetwork#2227 Bug: docker/for-linux#644 Bug: docker/for-linux#525 Signed-off-by: Piotr Karbowski <[email protected]> (cherry picked from commit e8ceb97) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Points out another symbol that Docker might need. in this case Docker's mesh network in swarm mode does not route Virtual IPs if it's unset. From /var/logs/docker.log: time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]: (iptables failed: iptables --wait -t mang le -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))" Bug: moby/libnetwork#2227 Bug: docker/for-linux#644 Bug: docker/for-linux#525 Signed-off-by: Piotr Karbowski <[email protected]> (cherry picked from commit e8ceb97) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Points out another symbol that Docker might need. in this case Docker's mesh network in swarm mode does not route Virtual IPs if it's unset. From /var/logs/docker.log: time="2021-02-19T18:15:39+01:00" level=error msg="set up rule failed, [-t mangle -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257]: (iptables failed: iptables --wait -t mang le -A INPUT -d 10.0.1.2/32 -j MARK --set-mark 257: iptables v1.8.7 (legacy): unknown option \"--set-mark\"\nTry `iptables -h' or 'iptables --help' for more information.\n (exit status 2))" Bug: moby/libnetwork#2227 Bug: docker/for-linux#644 Bug: docker/for-linux#525 Signed-off-by: Piotr Karbowski <[email protected]> (cherry picked from commit e8ceb97) Signed-off-by: Sebastiaan van Stijn <[email protected]>
TLDR
@fcrisciani I have read and understood how mesh is working using ingress network and ingress_sbox on docker_gwbridge and using a custom overlay network for services.
Read a lot of stuff and checked everything out (see docker-support.log) I cannot reach the published external port. To avoid side effects my firewallD is not running on the swarm cluster.
Issue type
Installing nginx with replica 1 cannot be accessed via the published port 80, suppose
routing mesh is not working
Expect
Can access published port for every node with w3m http://localhost
Got
Cannot load http://localhost
OS Version/build
Kernel: 4.4.x
OS: Ubuntu 18.04 LTS
Arch: arm64
Docker: 18.03.1-ce
API version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:16:22 2018
OS/Arch: linux/arm64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:14:27 2018
OS/Arch: linux/arm64
Experimental: true
Steps to reproduce
Diagnostic log
See https://gist.github.com/giminni/1ab53616d6529baeace0f2e6d2eac65a
The text was updated successfully, but these errors were encountered: