Skip to content

Commit b399df8

Browse files
committed
Update the KEP with Beta requirements
Also update the KEP to reflect the Alpha implementation details
1 parent d95be9b commit b399df8

File tree

2 files changed

+78
-35
lines changed

2 files changed

+78
-35
lines changed

keps/sig-node/4205-psi-metric/README.md

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
- [Story 1](#story-1)
1111
- [Risks and Mitigations](#risks-and-mitigations)
1212
- [Design Details](#design-details)
13-
- [CPU](#cpu)
14-
- [Memory](#memory)
15-
- [IO](#io)
13+
- [CPU](#cpu)
14+
- [Memory](#memory)
15+
- [IO](#io)
1616
- [Test Plan](#test-plan)
1717
- [Prerequisite testing updates](#prerequisite-testing-updates)
1818
- [Unit tests](#unit-tests)
@@ -125,16 +125,25 @@ full avg10=0.00 avg60=0.00 avg300=0.00 total=0
125125
```
126126

127127
```go
128+
// PSI data for an individual resource.
128129
type PSIData struct {
129-
Avg10 *float64 `json:"avg10"`
130-
Avg60 *float64 `json:"avg60"`
131-
Avg300 *float64 `json:"avg300"`
132-
Total *float64 `json:"total"`
130+
// Total time duration for tasks in the cgroup have waited due to congestion.
131+
// Unit: nanoseconds.
132+
Total uint64 `json:"total"`
133+
// The average (in %) tasks have waited due to congestion over a 10 second window.
134+
Avg10 float64 `json:"avg10"`
135+
// The average (in %) tasks have waited due to congestion over a 60 second window.
136+
Avg60 float64 `json:"avg60"`
137+
// The average (in %) tasks have waited due to congestion over a 300 second window.
138+
Avg300 float64 `json:"avg300"`
133139
}
134140

141+
// PSI statistics for an individual resource.
135142
type PSIStats struct {
136-
Some *PSIData `json:"some,omitempty"`
137-
Full *PSIData `json:"full,omitempty"`
143+
// PSI data for some tasks in the cgroup.
144+
Some PSIData `json:"some,omitempty"`
145+
// PSI data for all tasks in the cgroup.
146+
Full PSIData `json:"full,omitempty"`
138147
}
139148
```
140149

@@ -146,15 +155,15 @@ metric data will be available through CRI instead.
146155
```go
147156
type CPUStats struct {
148157
// PSI stats of the overall node
149-
PSI cadvisorapi.PSIStats `json:"psi,omitempty"`
158+
PSI *PSIStats `json:"psi,omitempty"`
150159
}
151160
```
152161

153162
##### Memory
154163
```go
155164
type MemoryStats struct {
156165
// PSI stats of the overall node
157-
PSI cadvisorapi.PSIStats `json:"psi,omitempty"`
166+
PSI *PSIStats `json:"psi,omitempty"`
158167
}
159168
```
160169

@@ -166,7 +175,7 @@ type IOStats struct {
166175
Time metav1.Time `json:"time"`
167176

168177
// PSI stats of the overall node
169-
PSI cadvisorapi.PSIStats `json:"psi,omitempty"`
178+
PSI *PSIStats `json:"psi,omitempty"`
170179
}
171180

172181
type NodeStats struct {
@@ -220,6 +229,7 @@ This can inform certain test coverage improvements that we want to do before
220229
extending the production code to implement this enhancement.
221230
-->
222231
- `k8s.io/kubernetes/pkg/kubelet/server/stats`: `2023-10-04` - `74.4%`
232+
- `k8s.io/kubernetes/pkg/kubelet/stats`: `2025-06-10` - `77.4%`
223233

224234
##### Integration tests
225235

@@ -238,6 +248,8 @@ For Beta and GA, add links to added tests together with links to k8s-triage for
238248
https://storage.googleapis.com/k8s-triage/index.html
239249
-->
240250

251+
Within Kubernetes, the feature is implemented solely in kubelet. Therefore a Kubernetes integration test doesn't apply here.
252+
241253
Any identified external user of either of these endpoints (prometheus, metrics-server) should be tested to make sure they're not broken by new fields in the API response.
242254

243255
##### e2e tests
@@ -252,7 +264,7 @@ https://storage.googleapis.com/k8s-triage/index.html
252264
We expect no non-infra related flakes in the last month as a GA graduation criteria.
253265
-->
254266

255-
- <test>: <link to test coverage>
267+
- `test/e2e_node/summary_test.go`: `https://storage.googleapis.com/k8s-triage/index.html?test=test%2Fe2e_node%2Fsummary_test.go`
256268

257269
### Graduation Criteria
258270

@@ -269,7 +281,8 @@ We expect no non-infra related flakes in the last month as a GA graduation crite
269281
- Allowing time for feedback.
270282

271283
#### GA
272-
- TBD
284+
- Gather evidence of real world usage.
285+
- No major issue reported.
273286

274287
#### Deprecation
275288

@@ -338,12 +351,6 @@ well as the [existing list] of feature gates.
338351
- [X] Feature gate (also fill in values in `kep.yaml`)
339352
- Feature gate name: KubeletPSI
340353
- Components depending on the feature gate: kubelet
341-
- [ ] Other
342-
- Describe the mechanism:
343-
- Will enabling / disabling the feature require downtime of the control
344-
plane?
345-
- Will enabling / disabling the feature require downtime or reprovisioning
346-
of a node?
347354

348355
###### Does enabling the feature change any default behavior?
349356

@@ -368,7 +375,7 @@ NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
368375
Yes
369376

370377
###### What happens if we reenable the feature if it was previously rolled back?
371-
No PSI metrics will be availabe in kubelet Summary API nor Prometheus metrics if the
378+
No PSI metrics will be available in kubelet Summary API nor Prometheus metrics if the
372379
feature was rolled back.
373380

374381
###### Are there any tests for feature enablement/disablement?
@@ -405,13 +412,34 @@ rollout. Similarly, consider large clusters and how enablement/disablement
405412
will rollout across nodes.
406413
-->
407414

415+
The PSI metrics in kubelet Summary API and Prometheus metrics are for monitoring purpose,
416+
and are not used by Kubernetes itself to inform workload lifecycle decisions. Therefore it should
417+
not impact running workloads.
418+
419+
If there is a bug and kubelet fails to serve the metrics during rollout, the kubelet Summary API
420+
and Prometheus metrics could be corrupted, and other components that depend on those metrics could
421+
be impacted. Disabling the feature gate / rolling back the feature should be safe.
422+
408423
###### What specific metrics should inform a rollback?
409424

410425
<!--
411426
What signals should users be paying attention to when the feature is young
412427
that might indicate a serious problem?
413428
-->
414429

430+
PSI metrics exposed at kubelet `/metrics/cadvisor` endpoint:
431+
432+
```
433+
container_pressure_cpu_stalled_seconds_total
434+
container_pressure_cpu_waiting_seconds_total
435+
container_pressure_memory_stalled_seconds_total
436+
container_pressure_memory_waiting_seconds_total
437+
container_pressure_io_stalled_seconds_total
438+
container_pressure_io_waiting_seconds_total
439+
```
440+
441+
kubelet Summary API at the `/stats/summary` endpoint.
442+
415443
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
416444

417445
<!--
@@ -420,12 +448,23 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
420448
are missing a bunch of machinery and tooling and can't do that now.
421449
-->
422450

451+
Test plan:
452+
- Create pods when the feature is alpha and disabled
453+
- Upgrade kubelet so the feature is beta and enabled
454+
- Pods should continue to run
455+
- PSI metrics should be reported in kubelet Summary API and Prometheus metrics
456+
- Roll back kubelet to previous version
457+
- Pods should continue to run
458+
- PSI metrics should no longer be reported
459+
423460
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
424461

425462
<!--
426463
Even if applying deprecation policies, they may still surprise some users.
427464
-->
428465

466+
No
467+
429468
### Monitoring Requirements
430469

431470
<!--
@@ -456,13 +495,8 @@ and operation of this feature.
456495
Recall that end users cannot usually observe component logs or access metrics.
457496
-->
458497

459-
- [ ] Events
460-
- Event Reason:
461-
- [ ] API .status
462-
- Condition name:
463-
- Other field:
464-
- [ ] Other (treat as last resort)
465-
- Details:
498+
- [x] Other (treat as last resort)
499+
- Details: The feature is only about metrics surfacing. One can know that it is working by reading the metrics.
466500

467501
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
468502

@@ -481,6 +515,8 @@ These goals will help you determine what you need to measure (SLIs) in the next
481515
question.
482516
-->
483517

518+
kubelet Summary API and Prometheus metrics should continue serving traffics meeting their originally targeted SLOs
519+
484520
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
485521

486522
<!--
@@ -584,6 +620,7 @@ NA
584620

585621
- 2023/09/13: Initial proposal
586622
- 2025/06/10: Drop Phase 2 from this KEP. Phase 2 will be tracked in its own KEP to allow separate milestone tracking
623+
- 2025/06/10: Update the proposal with Beta requirements
587624

588625
## Drawbacks
589626

keps/sig-node/4205-psi-metric/kep.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
title: PSI based Node Conditions
1+
title: Expose PSI Metrics
22
kep-number: 4205
33
authors:
44
- "@ndixita"
55
- "@dragoncell"
6+
- "roycaihw"
67
owning-sig: sig-node
78
participating-sigs:
89
- sig-node
@@ -21,27 +22,32 @@ see-also: []
2122
replaces: []
2223

2324
# The target maturity stage in the current dev cycle for this KEP.
24-
stage: alpha
25+
stage: beta
2526

2627
# The most recent milestone for which work toward delivery of this KEP has been
2728
# done. This can be the current (upcoming) milestone, if it is being actively
2829
# worked on.
29-
latest-milestone: "v1.33"
30+
latest-milestone: "v1.34"
3031

3132
# The milestone at which this feature was, or is targeted to be, at each stage.
3233
milestone:
3334
alpha: "v1.33"
35+
beta: "v1.34"
3436

3537
# The following PRR answers are required at alpha release
3638
# List the feature gate name and the components for which it must be enabled
3739
feature-gates:
38-
- name: PSINodeCondition
40+
- name: KubeletPSI
3941
components:
4042
- kubelet
41-
- kube-controller-manager
42-
- kube-scheduler
4343

4444
disable-supported: true
4545

4646
# The following PRR answers are required at beta release
47-
metrics: []
47+
metrics:
48+
- container_pressure_cpu_stalled_seconds_total
49+
- container_pressure_cpu_waiting_seconds_total
50+
- container_pressure_memory_stalled_seconds_total
51+
- container_pressure_memory_waiting_seconds_total
52+
- container_pressure_io_stalled_seconds_total
53+
- container_pressure_io_waiting_seconds_total

0 commit comments

Comments
 (0)