-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubeadm: fix RequiredIPVSKernelModulesAvailableCheck #70051
kubeadm: fix RequiredIPVSKernelModulesAvailableCheck #70051
Conversation
/cc @neolit123 |
cdf54b0
to
432a4a8
Compare
/area kubeadm |
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 @bart0sh
added some minor comments / questions.
432a4a8
to
63bf08e
Compare
@neolit123 thank you for the review! |
We probably should fix also kube-proxy, there is similar check, because it's disables IPVS if required kernel modules not found |
@neolit123 Do you want me to fix it in this PR or a separate PR would be ok too? |
@bart0sh probably best to fix it in a separate PR once this PR get approved. |
Thanks @neolit123 A quick question: are you using IPVS proxier? cc @islinwb @stewart-yu @Lion-Wei for review. |
1 similar comment
Thanks @neolit123 A quick question: are you using IPVS proxier? cc @islinwb @stewart-yu @Lion-Wei for review. |
In the function, first part is |
Why is it needed, if all modules are existing and working well, just not in listed in Example, my case: |
It's checking loaded modules as far as I understand the code.
It's not deleted. I just added check for installed modules. I've tested this solution. When ip_vs* modules are not builtin and not loaded before the kubeadm run they're loaded automatically if they're installed. The same reported in the issue: |
pkg/util/ipvs/kernelcheck_linux.go
Outdated
if !match { | ||
builtInModules.Insert(string(builtInMode)) | ||
out, err = r.Executor.Command("modinfo", module).CombinedOutput() |
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.
why add code in the check of built-in modules? first check ipvs moduels if they are loaded and if they exists would solve the probelm
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.
it wouldn't as far as I understood. If they're not loaded and not installed they're still be built into the kernel. We should do all 3 checks in my opinion.
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.
We should do all 3 checks in my opinion.
Yes. I think it's better put it seperate and check before builtin modules (few OSes have those in builtin modules).
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.
That makes sense. Will do. Thank you for the idea!
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.
any update?
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.
@stewart-yu I'm travelling. will update this PR today/tomorrow.
63bf08e
to
abbd30a
Compare
@bart0sh: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/test pull-kubernetes-verify |
No need to load those modules automatically. #59566 (comment)
If user have all necessary modules, he will not see this warning anymore, that's true. And we have this function now. |
That's absolutely not true. I have all required modules installed:
However, the check still makes incorrect and confusing warning message:
This is plain wrong: As IPVS proxier is used just fine after
Therefore both recommendations:
don't make sense and meaningless. @neolit123, @kad, @timothysc please, help me to get this PR merged. It's stuck under review for 24 days already. It's a valid fix for kubernetes/kubeadm#975 |
Agree, warning still there if modules not loaded but existing on the system.
kube-proxy already doing that, we don't need to load them on the preflight check by kubeadm. |
That's wrong.
Secondary, loaded those file in system, like commad
Third, check loaded modules Finally, If no kernel modules, check builtin modules You missing the secondary step, that's true? So the third and finally step throw warning. BTW, No need to load those modules automatically. https://github.com/kubernetes/kubernetes/pull/59566#issuecomment-390212614, you should load |
@stewart-yu |
sure. Which channel are you at? What's your nick? I couldn't find you there. |
This is a main point of misunderstanding. You don't need to do any 'modprobe -- ' to be able to work with IPVS. Current implementation of RequiredIPVSKernelModulesAvailable check insist on that and this is confusing. That was the reason for this issue: kubernetes/kubeadm#975 and this PR. |
@bart0sh @kvaps That's the information I got, Please consider, thanks. |
@Lion-Wei It still looks confusing to me. Why to throw a warning that can be ignored in most of the cases and everything would work just fine? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@bart0sh please close this PR as it seems the PR replaces it. |
kube-proxy anyway executed in privileged mode as it need access to control host kernel IPVS and iptables rules. |
|
||
// Check if builtin modules exist | ||
builtinModsFilePath := fmt.Sprintf("/lib/modules/%s/modules.builtin", kernelVersion) | ||
out, err = r.Executor.Command("cut", "-f1", "-d", " ", builtinModsFilePath).CombinedOutput() |
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.
Can we get rid of this by replacing it with simple read parse function?
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.
I'd be happy to do that if we reach overall agreement to accept this patch with @Lion-Wei and @stewart-yu
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.
1 would be great if we can use some of the existing util functions for checking these i.e. https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/iptables/proxier.go#L129-L138
Let's give @Lion-Wei and @stewart-yu another chance to accept it. I still think it's a correct fix and after @kad's comment I don't see any reason of not accepting it. |
/assign @stewart-yu |
@stewart-yu kindly ping for review&acceptance. Please consider last comment from @kad. |
@bart0sh: PR needs rebase. 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. |
@bart0sh Can you please address the remaining comments and rebase this PR so we can continue reviewing? |
Can you please review this pr instead? |
@bart0sh Reviewed, please close this one out |
Will do after that one will be approved. |
closed as #75036 has been merged |
What type of PR is this?
/kind bug
What this PR does / why we need it:
kubeadm IPVS check confuses users as it doesn't
take into account installed modules. It only checks loaded
and builtin modules. If it can't find required module among
loaded or/and builtin modules it fails.
However, it shouldn't be considered an error as installed
modules can still be loaded.
Modified RequiredIPVSKernelModulesAvailableCheck code to
also check installed modules using 'modinfo '
Which issue(s) this PR fixes:
Fixes: kubernetes/kubeadm#975
Does this PR introduce a user-facing change?: