Skip to content

Add missing kernel config checks#6946

Merged
cwayne18 merged 1 commit into
k3s-io:masterfrom
st3iny:fix/noid/kernel-config-check
Mar 14, 2023
Merged

Add missing kernel config checks#6946
cwayne18 merged 1 commit into
k3s-io:masterfrom
st3iny:fix/noid/kernel-config-check

Conversation

@st3iny

@st3iny st3iny commented Feb 11, 2023

Copy link
Copy Markdown
Contributor

Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Proposed Changes

I was experimenting with minimal linux kernels and k3s the other day. I used your excellent check-config.sh script to check my configuration. However, k3s didn't run and required extra config options that were missing from the script.

Types of Changes

I added 2 missing config checks to the script. I categorized them as required as the server failed to start without them. Furthermore, I bootstrapped vanilla servers without any extra configuration (e.g. env variables) during my testing.

Verification

Here are some error messages taken from journalctl -u k3s.service.

Regarding NETFILTER_XT_MATCH_COMMENT:
Feb 11 22:57:15 virtoo k3s[6375]: panic: F0211 22:57:15.908590 6375 network_policy_controller.go:341] Failed to run iptables command to insert in INPUT chain running [/usr/bin/iptables -t filter -I INPUT 1 -m comment --comment kube-router netpol - 4IA2OSFRMVNDXBVV -j KUBE-ROUTER-INPUT --wait]: exit status 1: Warning: Extension comment revision 0 not supported, missing kernel module?

Regarding NETFILTER_XT_MATCH_MULTIPORT:
Feb 11 23:02:34 virtoo k3s[2678]: panic: F0211 23:02:34.075017 2678 network_policy_controller.go:336] Failed to verify rule exists in KUBE-ROUTER-INPUT chain due to running [/usr/bin/iptables -t filter -C KUBE-ROUTER-INPUT -p tcp -m comment --comment allow LOCAL TCP traffic to node ports - LR7XO7NXDBGQJD2M -m addrtype --dst-type LOCAL -m multiport --dports 30000:32767 -j RETURN --wait]: exit status 2: Warning: Extension multiport revision 0 not supported, missing kernel module?

Those error messages vanish and the server starts when both match extensions are compiled into the kernel (or as modules).

Testing

I don't think this is subject to unit testing. Please let me know otherwise.

Linked Issues

User-Facing Change

NONE

Further Comments

Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and
NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny requested a review from a team as a code owner February 11, 2023 23:14
@cwayne18

Copy link
Copy Markdown
Member

Thanks a lot for the PR and especially for signing your commit! Just as a heads up we're currently under code freeze as we enter release week, but we can review and merge for you once freeze is lifted (assuming review passes). Thanks again!

@cwayne18

Copy link
Copy Markdown
Member

Thanks again for the contribution!

@cwayne18 cwayne18 merged commit a912902 into k3s-io:master Mar 14, 2023
@st3iny st3iny deleted the fix/noid/kernel-config-check branch March 14, 2023 18:22
dereknola pushed a commit to dereknola/k3s that referenced this pull request Mar 29, 2023
Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and
NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
dereknola pushed a commit to dereknola/k3s that referenced this pull request Mar 29, 2023
Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and
NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
dereknola added a commit that referenced this pull request Mar 29, 2023
* Add missing kernel config checks (#6946)

Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and
NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>

* Enhance `k3s check-config` (#7091)

* Move  CONFIG_CGROUP_PIDS to Required

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
dereknola added a commit that referenced this pull request Mar 29, 2023
* Add missing kernel config checks (#6946)

Add additional kernel config checks for NETFILTER_XT_MATCH_COMMENT and
NETFILTER_XT_MATCH_MULTIPORT as they are both required to run k3s.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>

* Enhance `k3s check-config` (#7091)

* Move  CONFIG_CGROUP_PIDS to Required

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
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.

4 participants