Skip to content

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.

This is NOT a blocker for KEP-2400 GA, but rather a nice-to-have addition.

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

@haircommander
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 Jul 2, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 778e43f05c4e5a310aaa4ee00ef1167f9d325f15

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2025
@iholder101 iholder101 force-pushed the swap/add-container-swap-limit-metric branch from fed3322 to 1ac60e3 Compare July 8, 2025 09:38
@k8s-ci-robot k8s-ci-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 Jul 8, 2025
@iholder101
Copy link
Contributor Author

@mrunalp (for e2e node tests)
@dashpole (for metrics)

can you please take a look for approval?

This PR was LGTMed twice above. The LGTM was dropped due to a rebase.
@mrunalp @dashpole do you mind having a look for approval?

@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 Jul 8, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6f4f3370680c7d9c1525f6e014db016a79e0ede1

@ajaysundark
Copy link
Contributor

/retest

@iholder101
Copy link
Contributor Author

Hey @dashpole!
This PR was LGTMed from the node side by 4 people [1][2][3][4].

Is there something missing from your side?
Thanks!

[1] #132348 (comment)
[2] #132348 (comment)
[3] #132348 (comment)
[4] #132348 (comment)

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

/lgtm
for sig-instrumentation

@iholder101
Copy link
Contributor Author

@SergeyKanzhelev would you be willing to approve this? Thanks!

@dchen1107
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ajaysundark, dashpole, dchen1107, iholder101

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 Jul 17, 2025
@k8s-ci-robot k8s-ci-robot merged commit 8f312e6 into kubernetes:master Jul 17, 2025
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone Jul 17, 2025
@github-project-automation github-project-automation bot moved this from Archive-it to Done in SIG Node CI/Test Board Jul 17, 2025
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in SIG Node: code and documentation PRs Jul 17, 2025
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/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.

Development

Successfully merging this pull request may close these issues.

expose calculated swap limit metric for containers

8 participants