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

KEP-4205: KEP to add PSI metrics in Summary API, and for PSI based node actions #4230

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

ndixita
Copy link
Contributor

@ndixita ndixita commented Sep 21, 2023

  • One-line PR description: This KEP lays the initial foundations to use PSI metrics for setting Node Conditions.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 21, 2023
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 21, 2023
@ndixita
Copy link
Contributor Author

ndixita commented Sep 21, 2023

/assign @rphillips
/assign @haircommander
/assign @bobbypage

Copy link
Contributor

@tzneal tzneal left a comment

Choose a reason for hiding this comment

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

+1, this may help provide more observability to users for nodes that are overloaded without requiring logging into the node to troubleshoot.

keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
@rphillips
Copy link
Member

I think we will want to propagate the PSI metrics from the main Kubelet slices separately: /, system.slice, and kubepods.slice. I do not see that reflected in this enhancement. Thoughts?

Copy link
Member

@bobbypage bobbypage left a comment

Choose a reason for hiding this comment

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

Thank you for proposing this KEP, I am super excited to see us build on top of cgroupv2 using features like PSI in the kubelet! Left a few comments.

keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
Copy link
Contributor

@haircommander haircommander left a comment

Choose a reason for hiding this comment

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

A couple more nits, and we still need some resolution on the multi-tiered node condition (separate for kubepods cgroup vs system cgroup), or at least a mention of it as we have a couple of releases between now and then

Comment on lines 147 to 148
Avg300 *float64 `json:”avg300”`
Total *float64 `json:”total”`
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation is weird here

Copy link
Contributor

Choose a reason for hiding this comment

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

still is

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment still holds

keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
#### Phase 1: Alpha

- PSI integrated in kubelet behind a feature flag.
- Initial e2e tests completed and enabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

may be tricky to have e2e tests if we need CRI extensions to collect the metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we can decide on the coverage later?

Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I'd drop this and replace it with unit testing

Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of CRI extensions are we talking about here? Are those optional, iow. the functionality will be only available for some container runtimes? (I'm not a CRI expert 😉 )

@ndixita ndixita force-pushed the psi-kep branch 3 times, most recently from b757350 to e39ea7d Compare October 4, 2023 00:11
@haircommander
Copy link
Contributor

a couple more nits. I propose we mostly focus reviews on phase 1 now--which to me mostly looks good--as the following phases will likely change with time

@rayandas rayandas mentioned this pull request Oct 4, 2023
10 tasks
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

#prr-shadow

keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Outdated Show resolved Hide resolved
keps/sig-node/4205-psi-metric/README.md Show resolved Hide resolved
keps/sig-node/4205-psi-metric/kep.yaml Show resolved Hide resolved
@ndixita ndixita force-pushed the psi-kep branch 2 times, most recently from 2ce2c93 to 44189d1 Compare October 4, 2023 22:37
@ndixita ndixita force-pushed the psi-kep branch 4 times, most recently from ddeb0eb to c280955 Compare October 5, 2023 21:48
@rphillips
Copy link
Member

I took a pass on a review. @soltysh's comments should be addressed before we merge this; otherwise, lgtm.

@tzneal
Copy link
Contributor

tzneal commented Oct 5, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2023
@ndixita
Copy link
Contributor Author

ndixita commented Oct 5, 2023

/assign deads2k

@ndixita
Copy link
Contributor Author

ndixita commented Oct 5, 2023

/assign @soltysh

Signed-off-by: Dixita Narang <ndixita@google.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2023
@johnbelamaric
Copy link
Member

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnbelamaric, mrunalp, ndixita

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 Oct 5, 2023
@k8s-ci-robot k8s-ci-robot merged commit 6765cba into kubernetes:master Oct 5, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 5, 2023
@tzneal
Copy link
Contributor

tzneal commented Oct 5, 2023

/lgtm

@BojanZelic
Copy link

I've been playing around with a similar idea to this, using node-problem-detector to set node conditions based off of PSI pressure indicators and ran into an issue that might affect this KEP.

Basically while CPU PSI pressure information is a good indicator of how overloaded a node is, it also gets set whenever CFS cpu throttling occurs.

For example if a user schedules a pod and sets their cpu limits too low so that throttling happens frequently we see that the PSI metrics for that cgroup also get elevated

root@ip-10-4-172-240:/sys/fs/cgroup/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podd75d892c_9bb2_4b9c_8ce2_7868eb91e665.slice/cri-containerd-fc6e9647769050baf7ea79855ca22b8496ed9b6dd2b7f06c2e583e18a25dc920.scope# cat cpu.pressure

some avg10=58.43 avg60=57.45 avg300=57.33 total=27907960587
full avg10=58.12 avg60=57.28 avg300=57.17 total=27494547488

which ends up being propagated to the system level metric:

cat /proc/pressure/cpu
some avg10=58.51 avg60=58.82 avg300=58.91 total=1062145857327
full avg10=0.00 avg60=0.00 avg300=0.00 total=0

cpu thottling:

root@ip-10-4-172-240:/sys/fs/cgroup/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podd75d892c_9bb2_4b9c_8ce2_7868eb91e665.slice/cri-containerd-fc6e9647769050baf7ea79855ca22b8496ed9b6dd2b7f06c2e583e18a25dc920.scope# cat cpu.stat
usage_usec 139474622887
user_usec 133159602378
system_usec 6315020509
core_sched.force_idle_usec 0
nr_periods 478231
nr_throttled 459361
throttled_usec 437837995163
nr_bursts 0
burst_usec 0

so elevated cpu PSI pressure could also mean heavy throttling on a container which doesn't necessarily mean there's a node-level issue occurring

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. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.