Skip to content
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

nftables support #20

Merged
merged 1 commit into from
Jun 12, 2020
Merged

nftables support #20

merged 1 commit into from
Jun 12, 2020

Conversation

Oats87
Copy link
Member

@Oats87 Oats87 commented May 20, 2020

Add iptables-detect scripts
Revert iptables to 1.8.3
Move iptables and related binaries/links to bin/aux instead of bin in order to help facilitate preferring iptables on the host rather than iptables from k3s-root
Create a second tar ball that only contains xtables/iptables binaries and links

k3s-io/k3s#1812

@Oats87 Oats87 force-pushed the nft-autodetect branch 6 times, most recently from 7e9c59b to 8cd14cf Compare June 9, 2020 18:01
…related links and binaries to bin/aux, create second set of tar balls only containing xtables/iptables binaries and links, add Drone CI with Dapper
Comment on lines +140 to +143
if [ "${lsb_dist}" = "redhatenterpriseserver" ]; then
# Set it to redhat, it will be changed to centos below anyways
lsb_dist='redhat'
fi
Copy link
Contributor

@dweomer dweomer Jun 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the centos | redhat*) case catch too much without this alias?

fi
;;

# We are running an operating system we don't know, default to nf_tables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to make this more complicated than it needs to be, but is it worth it when encountering an unknown OS $ID to fallback to $ID_LIKE if it is present in /etc/os-release? Likely such is more appropriate as a future improvement.

Copy link
Contributor

@dweomer dweomer Jun 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an example, k3OS /etc/os-release:

NAME="k3OS"
VERSION="k3OS v0.10.2"
ID=k3os
ID_LIKE=alpine
PRETTY_NAME="k3OS v0.10.2"
VERSION_ID="v0.10.2"
HOME_URL="https://k3os.io/"
SUPPORT_URL="https://k3os.io/"
BUG_REPORT_URL="https://github.com/rancher/k3os/issues"
ISO_URL="https://github.com/rancher/k3os/releases/download/v0.10.2/k3os-amd64.iso"

Granted, we aren't handling alpine either ...


}

if [ ! -z "$IPTABLES_MODE" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ ! -z "$IPTABLES_MODE" ]; then
if [ -n "$IPTABLES_MODE" ]; then

#!/bin/sh

# Copyright 2019 The Kubernetes Authors.
# Copyright 2020 Rancher Labs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which parts of this are our contributions?

@@ -4,7 +4,7 @@
#
################################################################################

IPTABLES_VERSION = 1.8.4
IPTABLES_VERSION = 1.8.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we are intentionally downgrading iptables does it make sense to leave a comment here as to why? Link to a known issue maybe?

Copy link
Contributor

@dweomer dweomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Oats87 would prefer the build system refactoring be in a separate PR but other than that only minor nits (see comments)

@cjellick
Copy link
Contributor

cjellick commented Jun 11, 2020

No need to separate into two prs now, but i agree this is good advice for the future.

@ibuildthecloud ibuildthecloud merged commit 9e29c7c into k3s-io:master Jun 12, 2020
@c-x-berger
Copy link

Now that this is merged, will https://rancher.com/docs/k3s/latest/en/advanced/#enabling-legacy-iptables-on-raspbian-buster become irrelevant in the next release?

@Oats87
Copy link
Member Author

Oats87 commented Jun 15, 2020

@c-x-berger There is a little bit of further work to be done (namely on k3s and within the install script) but yes, in a future release (with these changes incorporated) Debian buster will be able to operate in either mode. With the changes that are implemented here, K3s will use whatever mode you have chosen with update-alternatives as it's going to be defaulting to the system level binaries rather than k3s-root binaries from the get-go.

@Oats87 Oats87 mentioned this pull request Jun 16, 2020
@Oats87
Copy link
Member Author

Oats87 commented Jun 26, 2020

Also resolves: k3s-io/k3s#1959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants