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: update warning message for the swap check #125157

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

carlory
Copy link
Member

@carlory carlory commented May 28, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • NodeSwap graduates to Beta2 in Kubernetes 1.30.
  • In Beta2, the NodeSwap feature gate is on by default but fail-on-swap=false still needs to be provided to kubelet.

Which issue(s) this PR fixes:

xref kubernetes/kubeadm#2563

Special notes for your reviewer:

Does this PR introduce a user-facing change?

kubeadm: improve the warning message about the NodeSwap check which kubeadm performs on preflight.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 28, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 28, 2024
@carlory
Copy link
Member Author

carlory commented May 28, 2024

/cc @neolit123 @pacoxu

@k8s-ci-robot k8s-ci-robot added area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 28, 2024
return []error{errors.New("swap is supported for cgroup v2 only; " +
"the NodeSwap feature gate of the kubelet is beta and enabled by default; " +
"the kubelet must be properly configured to use swap; " +
"or disable swap on node")}, nil
Copy link
Member

Choose a reason for hiding this comment

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

Is there a document link about the NodeSwap feature gate we can add here?

Copy link
Member Author

@carlory carlory May 28, 2024

Choose a reason for hiding this comment

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

@SataQiu

Yes, I find two links that are related to the swap memory configuration in Kubernetes.

Which link is preferred?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@carlory carlory May 29, 2024

Choose a reason for hiding this comment

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

I remove "the NodeSwap feature gate of the kubelet is beta and enabled by default; ". once the feature is GA, we don't need to change warning messages again.

cc @pacoxu @neolit123 @SataQiu

https://kubernetes.io/docs/concepts/architecture/nodes/#swap-memory contains this information.

To enable swap on a node, the NodeSwap feature gate must be enabled on the kubelet (default is true), 

Copy link
Member

Choose a reason for hiding this comment

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

once the feature is GA we should remove the kubeadm check entirely.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you @kannon92

Any suggestions on my changes? please take another look, thank you. @pacoxu @SataQiu @neolit123

Copy link
Member

Choose a reason for hiding this comment

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

continuing to default a flag with a certain value so that the kubelet fails for a supposedly supported feature would be confusing for future and existing users...

does this mean we need to maintain a warning about swap forever in kubeadm?

Copy link
Member Author

Choose a reason for hiding this comment

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

According to #125157 (comment), I think so.

Copy link
Member

Choose a reason for hiding this comment

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

i recall discussions in kubernetes/kubeadm#2563 about removing the kubeadm preflight check about swap completely.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it’s not the best UX. Unfortunately the fail swap on flag predates the node swap feature by a few years.

It’s important to state that one can provision kubelet with swap enabled but the feature is disabled. This can mean that kubelet runs on a swap node but no pods actually use swap. The swap feature is about how certain workloads (Burstable QoS) could use swap memory.

We haven’t really discussed the option for defaulting fail swap to false as part of this KEP.

If one provisions kubelet with swap they don’t need to set anything with swap feature unless they want workloads to actually use swap. Default is to have NodeSwap on with swap disabled for all workloads.

@pacoxu
Copy link
Member

pacoxu commented May 29, 2024

/lgtm
And does this need a cherry-pick to v1.30?

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

LGTM label has been added.

Git tree hash: 49b5fa83a915179358bbd925b42e5985c7ee16a7

@neolit123
Copy link
Member

And does this need a cherry-pick to v1.30?

this does not fall under the critical, blocking bug category, so we should try not to backport similar changes to reduce backport noise.

@neolit123
Copy link
Member

/release-note-edit

kubeadm: improve the warning message about the NodeSwap check which kubeadm performs on preflight.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2024
@neolit123
Copy link
Member

please don't block the changes to the warning text on my comments.

Co-authored-by: Lubomir I. Ivanov <neolit123@gmail.com>
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/approve

@neolit123
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 76e3e8b4df9c56001058603bb9e5b2aa43c163bd

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlory, neolit123

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 Jun 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit 548d50d into kubernetes:master Jun 3, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone Jun 3, 2024
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants