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

update for KUBE-IPTABLES-HINT (and other 2022-ness) #3

Merged
merged 3 commits into from
Apr 12, 2022

Conversation

danwinship
Copy link
Contributor

KEP-3178 will (eventually) make kubelet create fewer iptables rules so we need to update iptables-wrappers to cope with that.

Also, misc updates for the last few years of iptables evolution...

/assign @dcbw

iptables 1.8.3 has a bug that makes it hang forever in certain cases,
requiring us to use "timeout" in the script. However, 1.8.4 is over
two years old at this point, and even Debian buster-backports has
1.8.5, so there's no reason to keep supporting 1.8.3. So remove that.

Also update the README and test Dockerfiles to use newer versions of
Fedora and Alpine to get a new-enough version.
Systems these days are more likely to be using iptables-nft than
iptables-legacy, so if there are no rules in either table, guess "nft"
rather than "legacy".
…CANARY first

Check for the (1.24+) KUBE-IPTABLES-HINT or (1.17+)
KUBE-KUBELET-CANARY chain first, and only fall back to counting total
number of legacy vs nft rules if we don't find that.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 31, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 31, 2022
@k8s-ci-robot k8s-ci-robot requested a review from dcbw March 31, 2022 19:36
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2022
@danwinship
Copy link
Contributor Author

/cc @aojea @squeed

@k8s-ci-robot
Copy link
Contributor

@danwinship: GitHub didn't allow me to request PR reviews from the following users: squeed.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @aojea @squeed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot requested a review from aojea April 5, 2022 12:14
@@ -16,7 +16,7 @@

FROM debian:buster

ARG INSTALL_ARGS
ARG INSTALL_ARGS=
Copy link

Choose a reason for hiding this comment

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

is this = right?
I've never seen this format, but doesn't mean isnot right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's just setting the default value to "". Which is what it was before, but podman complains now if you declare an ARG without giving it an explicit default value and then also don't set it from the command line:

danw@p1:iptables-wrappers (modernize)> make check-debian
./test/run-test.sh --build-fail debian
    docker build --no-cache -q -t iptables-wrapper-test-debian -f test/Dockerfile.test-debian .
    time="2022-04-11T09:12:43-04:00" level=warning msg="missing \"INSTALL_ARGS\" build argument. Try adding \"--build-arg INSTALL_ARGS=<VALUE>\" to the command line"

Comment on lines +111 to +114
# Check for kubernetes 1.17-or-later with iptables-legacy. We
# can't pass "-t mangle" to iptables-legacy-save because it would
# cause the kernel to create that table if it didn't already
# exist, which we don't want. So we have to grab all the rules
Copy link

Choose a reason for hiding this comment

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

🙃

mode=legacy
else
mode=nft
# With older kubernetes releases there may not be any _specific_
Copy link

Choose a reason for hiding this comment

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

I would say it's safe to assume KUBE-MARK-DROP will always exist -- it was added in, AFAICT, v1.4.

That said, it probably makes sense to just fall back to "literally any rules exist at all".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

KUBE-MARK-DROP is going away 🙂
kubernetes/enhancements#3179

@squeed
Copy link

squeed commented Apr 11, 2022

looks good to me. Thanks for thinking to maintain this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants