-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Ipvs: remove module check #114669
Ipvs: remove module check #114669
Conversation
To check kernel modules is a bad way to check functionality. This commit just removes the checks and makes it possible to use a statically linked kernel. Minimal updates to unit-tests are made.
This tests both ipvs and the configured scheduler
Skipping CI for Draft Pull Request. |
@uablrek: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Commit - proxy/ipvs: Remove kernel module testsJust removes the module checks |
proxy/ipvs: Check that a dummy virtual server can be addedThe logic should have been straight forward if not for the BUG:
As a work-around I re-do ipvs.GetVirtualServers after adding the dummy server and expect a len > 0. I will investigate this bug further. I hope it is in K8s, but it can be in "github.com/moby/ipvs". I build my own kernel so I can test this. I have built one kernel without Succesful start:
With ipvs, but without lc and lc configured as sheduler:
Kernel without ipvs:
This shows the bug. No error is returned from GetVirtualServers, nor AddVirtualServer even though there is no ipvs at all. |
/assign @thockin |
To update the scheduler without node reboot now works. The address for the probe VS is now 198.51.100.0 which is reseved for documentation, please see rfc5737. The comment about this is extended.
Updates after rewiewAddress "198.51.100.0" is now used for the probe VS. It is reserved for documentation only by rfc5737. To use that address IRL is an invalid configuration. The release-note is updated in this PR. The comment is extended:
I have tested to re-configure the scheduler without node-reboot and it works fine. |
About automatic kernel module loadingThe kernel request a module by an up-call to:
This is used for instance by iptables to load It is however possible to break this and enforce manual module loading. Example:
Since so many other things in K8s requires the automatic module loading to work I don't think some fall-back is necessary for the ipvs proxier. Actually I think it will not work without it in the current implementation. |
Slack thread in sig-docs on the test address https://kubernetes.slack.com/archives/C1J0BPD2M/p1671793688732989 |
Unfortunately the ipvs detect bug was in moby: moby/ipvs#27 |
I added this code for test; klog.V(5).InfoS("Virtual Servers after adding dummy", "count", len(vservers))
if len(vservers) == 0 {
klog.InfoS("Dummy VS not created", "scheduler", scheduler)
return fmt.Errorf("Ipvs not supported") // This is a BUG work-around
}
klog.V(5).InfoS("Dummy VS created", "vs", vs)
if scheduler == "wlc" {
klog.Fatalln("Terminate for test reasons")
}
if err := ipvs.DeleteVirtualServer(&vs); err != nil {
klog.ErrorS(err, "Could not delete dummy VS")
return err
} I started with the default scheduler "rr" and switched to "wlc", the expected sequence is:
The question is: will the lingering dummy VS be deleted? And the answer is: yes, it will. This is a fairly slow process so the interim-state between re-starts can be captured;
Here the old kubernetes svc is still using "rr", and the dummy VS can be spotted. But after the second re-start it is corrected:
The kubernetes svc now uses "wlc", and the dummy VS is deleted. |
Handle moby/ipvs#27 A work-around was already in place, but a segv would occur when the bug is fixed. That will not happen now.
I believe you that it is deleted but I can't see WHY it will be. After the log-fatal, it restarts. It hits |
The dummy VS is deleted in the kubernetes/pkg/proxy/ipvs/proxier.go Line 2121 in 685d639
This function is called from the
|
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.
Thanks!
/lgtm
/approve
LGTM label has been added. Git tree hash: 1a736a56740683422aef62bb4bf1dd483624ef08
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thockin, uablrek 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The check of kernel modules in proxy/ipvs prevents usage with statically linked kernels. Instead the function should be checked.
Which issue(s) this PR fixes:
Fixes #108579
Special notes for your reviewer:
Please read #108579 (comment).
Comments on individual commits below.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
N/A