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 swarm requires more iptables extensions #12028
Comments
OpenWRT packaging is in good order https://openwrt.org/packages/pkgdata/dockerd |
so probably some Docker compat/fix/patch is needed |
OpenWRT 21.02.5 r16688
Does not complain about iptables at all, it asks for vxlan modules for -doverlay and ipsec modules for --optencrypted. It is blazing difference between TurrisOS and OpenWRT, so you need to convince them to do right packaging for your task. |
It is not a build bug. Docker doesn't complain because it doesn't expect legacy iptables and OpenWRT's modular package architecture. Moreover, docker normally complains about missing kernel mods, not about missing binary libraries. It would nice if someone patched such checks into docker.
A very basic swarm setup shouldn't be considered exotic. Swarm is an essential feature of docker and relies on overlay networks for connectivity. I think it's safe to say that a docker user will expect swarm to work when no further warning is given.
Have you checked the overlay connectivity, not just the swarm joining? The swarm joining isn't affected and docker will exit with a successful join message. But without the conntrack, connectivity issues will occur. And without the ipvs, overlay networks will not be matched by OpenWRT's docker. That unless, I presume, a different method is used for creating and matching rules, such as nftables.
It's no effort to migrate the patch to TurrisOS. But it's not a TurrisOS-specific issue. It's a simple question of whether these two iptables extensions are to be included in OpenWRT. I'm sure they will serve other purposes as well, outside the docker scope. That's just a feature. But in case that a basic docker swarm setup doesn't work, without vlans or other optional features, it seems to me more like a bug. |
The OpenWRT 21 docker package uses conntrack. TurrisOS package is so different that particular issue does not map to OpenWRT. |
Where did you get information that the package is different? I gave your claim the benefit of the doubt, so I checked the Turris repositories and communication. I searched all project files for the term This is consistent with the communication [1], [2], [3]. According to the communication, there was no effort to integrate docker on its own, they just waited for OpenWRT to include it. The only tweaks necessary/considered were kernel related (e.g. the HudgeTLB control group access). Obviously, Turris OS modifies the build config. But you can't enable something in the config that doesn't exist. Another argument that supports my assumption that this is OpenWRT-related is that the issue has already been reported by another forum user in 2019, who by the way seemed to use his own build of/or vanilla OpenWRT. Turris might change other parts of the system and docker might need to adapt to that. The primary question is if the OpenWRT team considers legacy iptables a supported feature or 'exotic and optional'. If there's no support for iptables anymore, I just wonder why the package still exists.
What I mean is an interception of the |
I suspect there is older docker package at hand, because current OpenWRT package makes conntrack rules and does not require state module. OP missed the version numbers. |
It's no older package. I'm currently on The OpenWRT package/init scripts/patches do not utilize the state and ipvs extensions, |
|
|
Rather strange, my DOCKER-INGRESS table consists of ctstate rules with same version. |
Without the state extension, I'm missing one DNAT rule for the port mapping in one of two DOCKER-INGRESS chains. |
restarting |
@brada4 thanks for the help! So IIUC then you're not able to reproduce this and docker swarm works just fine in OpenWrt 21.02, 22.03 and master? |
No, 21.02.5, cannot reproduce -m state part at all. |
I have not restarted the firewall. @brada4 You didn't provide any reproducible information, so all I can go with are my own instructions. With these instructions, I've setup a vanilla OpenWRT, no custom build, and followed it through. The errors occur exactly as mentioned, are reproduceable on 22.03 (r20028-43d71ad93e). In fact, I even noticed another issue/necessary requirement, i.e. modprobe ip_vs. I also added the optional vxlan, etc. kmods to the installation set. This makes the instructions valid for a fresh vanilla setup. The docker files that reference |
I just run yout commands and no error with iptables. I guess firewall reload may trigger on some network change,worst is this event id not logged by default. |
Describe the bug
Not all features of docker swarm work without errors. There is no warning attached, so I presume docker swarm is an expected feature. When dockerd calls legacy iptables with its expected ipvs and state extensions, the rule setup fails. These rules are necessary for overlay networks.
OpenWrt version
r20028-43d71ad93e
OpenWrt target/subtarget
x86/64
Device
Microsoft Corporation Virtual Machine
Image kind
Official downloaded image
Steps to reproduce
Content of hello.yml
Actual behaviour
Logread shows iptables errors from dockerd.
Expected behaviour
No error messages are expected from the dockerd package or its swarm feature and its network types.
Additional info
libxt_ipvs.so
andlibxt_state.so
are not present in/usr/lib/
or/usr/lib/iptables/
.The error messages can be difficult to reproduce once the rules are setup or once the networks need to be recreated. It might be necessary to forcefully leave the swarm (i.e. destroy it), and to manually remove the default docker gw bridge network, followed by a restart of the dockerd init.d script or reboot. But the error messages speak for themselves, can be reproduced by
iptables -m ipvs
andiptables -m state
.Though I'm using Turris OS, they only clone OpenWRT and apply their own patches. The patches don't affect this issue, as documented by another forum user.
It's possible that other errors occur during a docker swarm setup or with macvlan and ipvlan networks. This issue only concerns the missing extensions for now. The extensions are part of the iptables source and just need to be included in the build.
Diffconfig
No response
Terms
The text was updated successfully, but these errors were encountered: