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

kubeadm: preflight check for enabled swap #50840

Merged
merged 1 commit into from
Sep 2, 2017

Conversation

kad
Copy link
Member

@kad kad commented Aug 17, 2017

What this PR does / why we need it:
Recent versions of kubelet require special flags if runned
on the system with enabled swap. Thus, remind user about either
disabling swap or add appropriate flag to kubelet settings

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

Special notes for your reviewer:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 17, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Aug 17, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @kad. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 17, 2017
Copy link
Contributor

@dmmcquay dmmcquay left a comment

Choose a reason for hiding this comment

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

Just a question about this potentially being a warning over an error.

buf = append(buf, scanner.Text())
}
if len(buf) > 1 {
return []error{fmt.Errorf("Running with swap on is not supported. Please disable swap or set kubelet's --fail-swap-on flag to false.")}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this potentially be a warning instead of an error? Will the kubelet fail if there is swap?

Copy link
Member Author

Choose a reason for hiding this comment

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

Note the return values order. it will return that message as warning now (errors is nil).
Kubelet actually will fail by default, but if user use --fail-swap-on=false it will work, so this check is inteded to be warning, as I don't see reason to force user to turn off swap if user knows consequences.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I just read it incorrectly.

@dmmcquay
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 Aug 17, 2017
buf = append(buf, scanner.Text())
}
if len(buf) > 1 {
return []error{fmt.Errorf("Running with swap on is not supported. Please disable swap or set kubelet's --fail-swap-on flag to false.")}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I just read it incorrectly.

@dmmcquay
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 17, 2017
@luxas
Copy link
Member

luxas commented Aug 18, 2017

cc @kubernetes/sig-node-pr-reviews @Random-Liu @yujuhong
Could we move this into the system verification check instead?

@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Aug 18, 2017
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 22, 2017
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 22, 2017
@kad
Copy link
Member Author

kad commented Aug 22, 2017

Rebased.

@kad
Copy link
Member Author

kad commented Aug 28, 2017

Anyone from sig-node to give an opinion about suggestion from @luxas ?

@dmmcquay
Copy link
Contributor

/test pull-kubernetes-e2e-gce-etcd3

scanner := bufio.NewScanner(f)
for scanner.Scan() {
buf = append(buf, scanner.Text())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you also be checking the scanner.Err()?

Recent versions of kubelet require special flags if runned
on the system with enabled swap. Thus, remind user about either
disabling swap or add appropriate flag to kubelet settings
@kad
Copy link
Member Author

kad commented Aug 29, 2017

@krousey possibility that scanner.Err will be non-nil is quite small, but possible. Added check for it. Thanks, good catch!

@kad
Copy link
Member Author

kad commented Aug 30, 2017

All what I see in failure logs seems to be flakes: 1. gcloud.compute.networks.create - quota exceeded on cluster. 2. Firewall check for e2e cluster setup. seems to be also sig-network flake related.

Can some org member re-trigger it enable bot to re trigger automatically ?

@kad
Copy link
Member Author

kad commented Aug 31, 2017

can someone kick bot to /retest flakes?

@dmmcquay
Copy link
Contributor

/test pull-kubernetes-e2e-gce-gpu
/test pull-kubernetes-e2e-gce-bazel
/test pull-kubernetes-e2e-gce-etcd3

@kad
Copy link
Member Author

kad commented Sep 1, 2017

timed out waiting for the condition in resource quota. Unrelated flake it seems.

@dmmcquay
Copy link
Contributor

dmmcquay commented Sep 1, 2017

/test pull-kubernetes-e2e-gce-etcd3

@kad
Copy link
Member Author

kad commented Sep 1, 2017

thx @dmmcquay for kicking test bot.
So, what do we do now with that PR ? code freeze is soon, it would be good to make decision.
May I suggest that if there is no comments from sig-node people, we can merge it as is now, and then move it to other place if it will be need ?

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.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2017
@dmmcquay
Copy link
Contributor

dmmcquay commented Sep 1, 2017

/lgtm

@luxas
Copy link
Member

luxas commented Sep 1, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmmcquay, kad, luxas

Associated issue requirement bypassed by: luxas

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2017
@abgworrall abgworrall modified the milestone: v1.8 Sep 2, 2017
@CaoShuFeng
Copy link
Contributor

/test pull-kubernetes-verify

@luxas
Copy link
Member

luxas commented Sep 2, 2017

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 2, 2017

@kad: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws 2e12787 link /test pull-kubernetes-e2e-kops-aws

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 2dd659d into kubernetes:master Sep 2, 2017
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. 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/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants