-
Notifications
You must be signed in to change notification settings - Fork 120
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
feat: build host iptables with nftables support #1106
Conversation
Build iptables with nftables support, and force to use nft version. See siderolabs/talos#9883 Signed-off-by: Andrey Smirnov <[email protected]>
@@ -30,6 +33,19 @@ steps: | |||
install: | |||
- | | |||
make install DESTDIR=/rootfs | |||
- | | |||
# fix up symlinks which point to legacy version to point to nft version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? How other distros build this? Maybe patching the Makefile would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our goal is not to have a generic solution which would work in any case. Talos enforces use of nftables
(vs. legacy). Kubernetes does a wrapper which picks up iptables version by detecting existing rules in either of the backends. We know we do nft, so no reason to overcomplicate, and point default binaries to nft one.
The host iptables should be used by CNI plugins, and they don't seem to be smart enough to figure out which version to use based on anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and iptables Makefile is not configurable on that - it always does iptables -> xtables-legacy-multi
.
This script should work even if the default is changed though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ # nsenter -t 1 -m /sbin/iptables -v
iptables v1.8.11 (nf_tables): no command specified
Try `iptables -h' or 'iptables --help' for more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what a result looks like:
drwxr-xr-x 0/0 0 2019-06-02 01:34 sbin/
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-nft -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-nft-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-nft-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/arptables-translate -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-nft -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-nft-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-nft-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ebtables-translate -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-apply -> iptables-apply
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-legacy -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-legacy-restore -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-legacy-save -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-nft -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-nft-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-nft-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-restore-translate -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/ip6tables-translate -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables -> xtables-nft-multi
-rwxr-xr-x 0/0 7052 2019-06-02 01:34 sbin/iptables-apply
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-legacy -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-legacy-restore -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-legacy-save -> xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-nft -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-nft-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-nft-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-restore -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-restore-translate -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-save -> xtables-nft-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/iptables-translate -> xtables-nft-multi
-rwxr-xr-x 0/0 79632 2019-06-02 01:34 sbin/xtables-legacy-multi
lrwxrwxrwx 0/0 0 2019-06-02 01:34 sbin/xtables-monitor -> xtables-nft-multi
-rwxr-xr-x 0/0 197856 2019-06-02 01:34 sbin/xtables-nft-multi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it basically changes "default" symlinks like iptables
but iptables-legacy
still points to legacy version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably drop iptables-legacy completely, for 1.10 with cgroups v1 (including kernel support).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, perhaps if no client complains. Should we add this to deprecation maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never even documented that it exists, it should only be used by CNI plugins, and we want them to use nftables always.
/m |
These are used by CNI plugins. Fixes siderolabs#9883 See siderolabs/pkgs#1106 Signed-off-by: Andrey Smirnov <[email protected]>
These are used by CNI plugins. Fixes siderolabs#9883 See siderolabs/pkgs#1106 Signed-off-by: Andrey Smirnov <[email protected]>
These are used by CNI plugins. Fixes siderolabs#9883 See siderolabs/pkgs#1106 Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit 07220fe)
These are used by CNI plugins. Fixes siderolabs#9883 See siderolabs/pkgs#1106 Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit 07220fe)
These are used by CNI plugins. Fixes siderolabs#9883 See siderolabs/pkgs#1106 Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit 07220fe)
Build iptables with nftables support, and force to use nft version.
See siderolabs/talos#9883