-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Conversation
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 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. |
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.
Just a question about this potentially being a warning over an error.
cmd/kubeadm/app/preflight/checks.go
Outdated
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 |
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.
Should this potentially be a warning instead of an error? Will the kubelet fail if there is swap?
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.
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.
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.
Yep, I just read it incorrectly.
/ok-to-test |
cmd/kubeadm/app/preflight/checks.go
Outdated
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 |
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.
Yep, I just read it incorrectly.
/lgtm |
cc @kubernetes/sig-node-pr-reviews @Random-Liu @yujuhong |
Rebased. |
Anyone from sig-node to give an opinion about suggestion from @luxas ? |
/test pull-kubernetes-e2e-gce-etcd3 |
scanner := bufio.NewScanner(f) | ||
for scanner.Scan() { | ||
buf = append(buf, scanner.Text()) | ||
} |
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.
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
@krousey possibility that scanner.Err will be non-nil is quite small, but possible. Added check for it. Thanks, good catch! |
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 ? |
can someone kick bot to /retest flakes? |
/test pull-kubernetes-e2e-gce-gpu |
|
/test pull-kubernetes-e2e-gce-etcd3 |
thx @dmmcquay for kicking test bot. |
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.
/lgtm
/lgtm |
/approve no-issue |
[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 |
/test pull-kubernetes-verify |
/retest |
@kad: The following test 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. |
Automatic merge from submit-queue |
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: