Skip to content

[KEP-2400] Add a container_swap_limit_bytes metric #132348

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

iholder101
Copy link
Contributor

@iholder101 iholder101 commented Jun 17, 2025

What type of PR is this?

/kind feature
/sig node

What this PR does / why we need it:

Swap metrics were originally added as part of #118865.

This PR adds a container_swap_limit_bytes to report the calculated swap limit for each container and be available at the /metrics/resource endpoint.

After this is merged, we can consider adding this as part of kubectl top pod/node --show-swap, as a follow-up to #129458.

Which issue(s) this PR is related to:

Fixes #132228

Does this PR introduce a user-facing change?

Adds a `container_swap_limit_bytes` metric to expose the swap limit assigned to containers under the `LimitedSwap` swap behavior.

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

- [KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jun 17, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 17, 2025
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 17, 2025
@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-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubelet labels Jun 17, 2025
@k8s-ci-robot k8s-ci-robot requested review from dims and yujuhong June 17, 2025 09:45
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 17, 2025
@iholder101
Copy link
Contributor Author

@k8s-ci-robot
Copy link
Contributor

@iholder101: GitHub didn't allow me to request PR reviews from the following users: yuanwang04.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @ajaysundark @haircommander @yuanwang04

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.

@github-project-automation github-project-automation bot moved this from Triage to Waiting on Author in SIG Node: code and documentation PRs Jun 18, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 19, 2025
@iholder101 iholder101 force-pushed the swap/add-container-swap-limit-metric branch from 79cf3a2 to 4a51da3 Compare June 19, 2025 09:07
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 19, 2025
@iholder101
Copy link
Contributor Author

/test pull-kubernetes-unit-windows-master

@iholder101
Copy link
Contributor Author

@iholder101: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-unit-windows-master [4a51da3]

Unit test failures don't seem related.

@iholder101 iholder101 force-pushed the swap/add-container-swap-limit-metric branch 3 times, most recently from ae0aa4d to 3e21de7 Compare June 22, 2025 10:14
@iholder101
Copy link
Contributor Author

/test pull-kubernetes-unit

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ajaysundark, iholder101
Once this PR has been reviewed and has the lgtm label, please assign sjenning for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@iholder101 iholder101 force-pushed the swap/add-container-swap-limit-metric branch from 3e21de7 to 839ec3e Compare June 23, 2025 06:50
@iholder101 iholder101 force-pushed the swap/add-container-swap-limit-metric branch from 839ec3e to fed4df0 Compare June 23, 2025 06:50
@k8s-ci-robot
Copy link
Contributor

@iholder101: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-unit-windows-master fed4df0 link false /test pull-kubernetes-unit-windows-master

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-sigs/prow repository. I understand the commands that are listed here.

@iholder101
Copy link
Contributor Author

@ajaysundark Is this ready for an LGTM from your side?
@haircommander do you mind having a quick look?

@ajaysundark
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 Jun 25, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 02a2f580528c6cafa7014f1fb20034ff3e2c5425

@ajaysundark
Copy link
Contributor

pull-kubernetes-unit-windows-master

seems unrelated

=== FAIL: pkg/kubeapiserver/options TestToAuthenticationConfig_OIDC/authentication_config_file_not_found (0.00s)
    authentication_test.go:1082: Got err: failed to load authentication configuration from file "nonexistent-file": open nonexistent-file: The system cannot find the file specified.; Want err: failed to load authentication configuration from file "nonexistent-file": open nonexistent-file: no such file or directory

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Archive-it in SIG Node CI/Test Board Jun 25, 2025
@iholder101 iholder101 mentioned this pull request Jul 1, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: Archive-it
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

expose calculated swap limit metric for containers
3 participants