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

Automatically load ipvs required kernel modules in kubeadm #59566

Merged
merged 2 commits into from
May 22, 2018

Conversation

stewart-yu
Copy link
Contributor

What this PR does / why we need it:
This PR is part of #59402, aiming to load kernel modules in kubeadm

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes ##59402

Special notes for your reviewer:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 8, 2018
@stewart-yu
Copy link
Contributor Author

/assign @m1093782566 @Lion-Wei

@m1093782566
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 8, 2018
@rramkumar1
Copy link
Contributor

In this PR, I would not delete the code in the ipvs proxier that loads the modules. I suggest you leave that as the final step once we know the module loading logic is propagated everywhere

@@ -0,0 +1,51 @@
package util
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we doing this in code? I thought the whole point was to move the kernel module loading logic into startup scripts. Doesn't kubeadm have startup scripts as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just WIP. Will fix for moment, thanks

Copy link

Choose a reason for hiding this comment

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

Actuall, kubeadm itself don't have startup scripts. You can do this work in kubernetes-anywhere, but that's just one use case of kubeadm.

loadModules := sets.NewString()
wantModules.Insert(ipvsModules...)
loadModules.Insert(mods...)
modules := wantModules.Difference(loadModules).UnsortedList()
Copy link

Choose a reason for hiding this comment

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

I think we still need check whether kernel modules are loaded in kube-proxy, 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.

i keep it now, will deleting it once all function well in kubeadm.

@stewart-yu stewart-yu force-pushed the ipvsGAkubeadm branch 3 times, most recently from 0c6c28c to 032f620 Compare February 9, 2018 07:34
@stewart-yu
Copy link
Contributor Author

/test pull-kubernetes-bazel-test

@stewart-yu stewart-yu force-pushed the ipvsGAkubeadm branch 2 times, most recently from 7a2233c to cb4785c Compare February 9, 2018 10:15
@dixudx
Copy link
Member

dixudx commented Feb 13, 2018

/area kubeadm

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 27, 2018
@fabriziopandini
Copy link
Member

/uncc @fabriziopandini
No experiences on IPVS ☹️

Might be a silly question, but what about nodes? Afaik this piece of code will be executed only on masters...

@k8s-ci-robot k8s-ci-robot removed the request for review from fabriziopandini March 2, 2018 16:11
@stewart-yu
Copy link
Contributor Author

Kindly ping @luxas @xiangpengzhao for review,PTAL

@Lion-Wei
Copy link

@fabriziopandini That's true, I think this pr still WIP. Need figure out a good way to identify ipvs mode in nodes. @stewart-yu

@m1093782566
Copy link
Contributor

/assign @luxas

@stewart-yu stewart-yu force-pushed the ipvsGAkubeadm branch 6 times, most recently from 9bed6ae to adef916 Compare May 21, 2018 12:13
@@ -926,6 +934,11 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.NodeConfigura
checks = addCommonChecks(execer, cfg, checks)

addIPv6Checks := false

checks = append(checks,
ipvsutil.RequiredIPVSKernelModulesAvailableCheck{},
Copy link
Member

Choose a reason for hiding this comment

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

please move this to the []Checker slice above

}

// Name returns label for RequiredIPVSKernelModulesAvailableCheck
func (r RequiredIPVSKernelModulesAvailableCheck) Name() string {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't you pass this as a reference here in both funcs? I think that's standard practice at least

Copy link
Contributor Author

@stewart-yu stewart-yu May 22, 2018

Choose a reason for hiding this comment

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

In general, that's right. But if add reference, will generate incompatible types errors. Also follow others checkers's format.

Copy link
Member

Choose a reason for hiding this comment

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

ok

loadModules.Insert(mods...)
modules := wantModules.Difference(loadModules).UnsortedList()

//TODO: add more testcase about builtin kernel ipvs support
Copy link
Member

Choose a reason for hiding this comment

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

Can you add more now or do you strictly want to do that later?


// Check try to validates IPVS required kernel modules exists or not.
func (r RequiredIPVSKernelModulesAvailableCheck) Check() (warnings, errors []error) {
errors = append(errors, fmt.Errorf("IPVS not supported for this platform"))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you should return an error here, as ipvs isn't required for kubeadm to run. This will work just fine on windows for example, even though those kernel modules aren't there

@stewart-yu
Copy link
Contributor Author

/cc @m1093782566 @luxas all comments updated, PTAL
Test coverage in local Env is 78.8%


// Check try to validates IPVS required kernel modules exists or not.
func (r RequiredIPVSKernelModulesAvailableCheck) Check() (warnings, errors []error) {
warnings = []error{}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove this line and return nil, nil directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix

@m1093782566
Copy link
Contributor

m1093782566 commented May 22, 2018

Looks good to me for IPVS part. @luxas for kubeadm part opinions and final approval.

@stewart-yu
Copy link
Contributor Author

/test pull-kubernetes-e2e-kops-aws

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2018
Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
Thanks @stewart-yu 🎉!

@luxas
Copy link
Member

luxas commented May 22, 2018

@m1093782566 please approve the ipvs parts

@m1093782566
Copy link
Contributor

m1093782566 commented May 22, 2018

Okay, let's merge this PR.

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: luxas, m1093782566, stewart-yu, timothysc

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@m1093782566
Copy link
Contributor

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

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. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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.