-
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
Merged
+87
−2
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ spec: | |
- libinih | ||
- libjson-c | ||
- liblzma | ||
- libmnl | ||
- libnftnl | ||
- libpopt | ||
- libseccomp | ||
- libselinux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: libmnl | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- sources: | ||
- url: https://www.netfilter.org/projects/libmnl/files/libmnl-{{ .libmnl_version }}.tar.bz2 | ||
destination: libmnl.tar.bz2 | ||
sha256: "{{ .libmnl_sha256 }}" | ||
sha512: "{{ .libmnl_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xjf libmnl.tar.bz2 --strip-components=1 | ||
|
||
./configure \ | ||
--prefix=/usr | ||
build: | ||
- | | ||
make -j $(nproc) | ||
install: | ||
- | | ||
make install DESTDIR=/rootfs | ||
finalize: | ||
- from: /rootfs | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: libnftnl | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
- stage: libmnl | ||
steps: | ||
- sources: | ||
- url: https://netfilter.org/projects/libnftnl/files/libnftnl-{{ .libnftnl_version }}.tar.xz | ||
destination: libnftnl.tar.bz2 | ||
sha256: "{{ .libnftnl_sha256 }}" | ||
sha512: "{{ .libnftnl_sha512 }}" | ||
prepare: | ||
- | | ||
tar -xf libnftnl.tar.bz2 --strip-components=1 | ||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig | ||
./configure \ | ||
--prefix=/usr | ||
build: | ||
- | | ||
make -j $(nproc) | ||
install: | ||
- | | ||
make install DESTDIR=/rootfs | ||
finalize: | ||
- from: /rootfs | ||
to: / |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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:
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
butiptables-legacy
still points to legacy versionThere 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.