Repository navigation
Check net.ipv4.ip_forward in validate-cks-node - #14773
bhouse-nexthop wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14773 +/- ##
=========================================
Coverage 18.32% 18.33%
- Complexity 16644 16655 +11
=========================================
Files 5939 5939
Lines 537787 537799 +12
Branches 65932 65935 +3
=========================================
+ Hits 98544 98580 +36
+ Misses 428033 428008 -25
- Partials 11210 11211 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- validate-cks-node now fails when /proc/sys/net/ipv4/ip_forward is not 1 - kubeadm join preflight requires it; without it an added external node passes validation, is rebooted into the join userdata and then fails kubeadm preflight with a less obvious error - each check adds its message to a FAILURES list; the script prints them all and exits 1 if there are any, so a new check is one more `if` block - missing packages and ip_forward are reported together in one run - the caller's log line says the node failed validation, not that it lacks dependencies, since the reason may not be a package - reads /proc rather than calling sysctl, which is not on a non-root user's PATH on Debian Signed-off-by: Brad House <bhouse@nexthop.ai>
70ee63a to
b92a9d1
Compare
Follow-up to "Check net.ipv4.ip_forward in validate-cks-node", for its amended upstream version (apache#14773). validate-cks-node now collects each failed check, missing packages and ip_forward alike, and prints all of them before exiting 1. The ip_forward failure says to set it under /etc/sysctl.d/, so it survives the reboot that follows. The add-node log says the node failed validation instead of listing only missing dependencies. Signed-off-by: Brad House <bhouse@nexthop.ai>
Follow-up to "Check net.ipv4.ip_forward in validate-cks-node", for its amended upstream version (apache#14773). validate-cks-node now collects each failed check, missing packages and ip_forward alike, and prints all of them before exiting 1. The ip_forward failure says to set it under /etc/sysctl.d/, so it survives the reboot that follows. The add-node log says the node failed validation instead of listing only missing dependencies. Signed-off-by: Brad House <bhouse@nexthop.ai>
|
Tested on a KVM lab running a main (24.0) build that includes this change. The node is a worker of a CKS cluster on Kubernetes 1.34.7 (Ubuntu-based CKS node). The PR targets 4.22; Result: 14 of 14 checks passed (gates included).
Not tested: the full |
Description
Fixes #14772
validate-cks-nodenow also checksnet.ipv4.ip_forward, whichkubeadm joinpreflight requires.ip_forward=0, packages OKip_forward=0, packages missingip_forward=1Each check adds its message to a
FAILURESlist; the script prints them all and exits 1 if there are any. A new check is one moreifblock.The caller's log line now says the node failed validation, not that it lacks dependencies.
Reads
/proc/sys/net/ipv4/ip_forwardrather than callingsysctl, which is not on a non-root user's PATH on Debian.Checks the live value. A value set at runtime but not persisted will pass here and still be lost on the reboot that follows.
Touches the same script as #14756 (missing-package array). The two merge cleanly; at most a trivial conflict depending on merge order.
Types of changes
Bug Severity
How Has This Been Tested?
Ran the script in bash with
dpkgstubbed and the/procpath pointed at a temp file:0bash -nclean.