Skip to content

Commit 341d83b

Browse files
authored
Merge pull request kubernetes#3353 from haircommander/stats-4
KEP-2371: update criteria for alpha
2 parents 9c87daa + 11053a2 commit 341d83b

File tree

2 files changed

+82
-12
lines changed

2 files changed

+82
-12
lines changed

keps/sig-node/2371-cri-pod-container-stats/README.md

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
- [CRI implementations](#cri-implementations)
2929
- [cAdvisor](#cadvisor-1)
3030
- [Test Plan](#test-plan)
31+
- [Prerequisite testing updates](#prerequisite-testing-updates)
32+
- [Unit tests](#unit-tests)
33+
- [Integration tests](#integration-tests)
34+
- [e2e tests](#e2e-tests)
3135
- [Graduation Criteria](#graduation-criteria)
3236
- [Alpha implementation](#alpha-implementation)
3337
- [Alpha -> Beta Graduation](#alpha---beta-graduation)
@@ -235,9 +239,10 @@ This will be described in more detail in the [design details section](#design-de
235239
### /metrics/cadvisor
236240

237241
1. Expose the metric fields provided in `/metrics/cadvisor` in an analogous Prometheus endpoint directly from the CRI implementation.
238-
5. cAdvisor should be updated to support no longer collecting stats that are duplicated with CRI implementation, and omit them from the report sent to `/metrics/cadvisor`.
242+
2. cAdvisor should be updated to support no longer collecting stats that are duplicated with CRI implementation, and omit them from the report sent to `/metrics/cadvisor`.
239243
3. The precise endpoint can change, but all the fields should be duplicated (so custom rules can be maintained).
240244
4. Kubelet does not collect nor expose pod and container level metrics that were formally collected for and exposed by `/metrics/cadvisor`.
245+
5. Kubelet should broadcast the endpoint from the CRI, similarly to how it does for `/metrics/cadvisor`.
241246

242247
### User Stories [optional]
243248

@@ -268,7 +273,6 @@ Thus, this KEP largely the plan described [here](#plan), with some changes:
268273
#### Open Questions
269274
1. For the newly introduced CRI API fields, should there be Windows and Linux specific fields?
270275

271-
272276
### Risks and Mitigations
273277

274278
- To properly move to CRI stats, it is likely there are some metrics that we'll want to not support (Accelerator/UserDefined). We should be careful to not break entities that rely on these metrics.
@@ -527,19 +531,85 @@ Below is the proposed strategy for doing so:
527531

528532
As a requirement for the Beta stage, cAdvisor must support optionally collecting and broadcasting these metrics, similarly to the changes needed for summary API.
529533

530-
531534
### Test Plan
532535

536+
<!--
537+
**Note:** *Not required until targeted at a release.*
538+
The goal is to ensure that we don't accept enhancements with inadequate testing.
539+
All code is expected to have adequate tests (eventually with coverage
540+
expectations). Please adhere to the [Kubernetes testing guidelines][testing-guidelines]
541+
when drafting this test plan.
542+
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
543+
-->
544+
545+
[x] I/we understand the owners of the involved components may require updates to
546+
existing tests to make this code solid enough prior to committing the changes necessary
547+
to implement this enhancement.
548+
549+
##### Prerequisite testing updates
550+
551+
<!--
552+
Based on reviewers feedback describe what additional tests need to be added prior
553+
implementing this enhancement to ensure the enhancements have also solid foundations.
554+
-->
555+
556+
##### Unit tests
557+
558+
<!--
559+
In principle every added code should have complete unit test coverage, so providing
560+
the exact set of tests will not bring additional value.
561+
However, if complete unit test coverage is not possible, explain the reason of it
562+
together with explanation why this is acceptable.
563+
-->
564+
565+
<!--
566+
Additionally, for Alpha try to enumerate the core package you will be touching
567+
to implement this enhancement and provide the current unit coverage for those
568+
in the form of:
569+
- <package>: <date> - <current test coverage>
570+
The data can be easily read from:
571+
https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
572+
This can inform certain test coverage improvements that we want to do before
573+
extending the production code to implement this enhancement.
574+
-->
575+
576+
- `pkg/kubelet/server/stats`: 06-15-2022 - 74.9
577+
578+
##### Integration tests
579+
580+
<!--
581+
This question should be filled when targeting a release.
582+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
583+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
584+
https://storage.googleapis.com/k8s-triage/index.html
585+
-->
586+
533587
- Internally in the Kubelet, there should be integration tests verifying that information gotten from the two sources is not too different.
534588
- Each CRI implementation should do regression testing on performance to make sure the gathering of these stats is reasonably efficient.
535589
- Any identified external user of either of these endpoints (prometheus, metrics-server) should be tested to make sure they're not broken by API changes.
536590

591+
592+
##### e2e tests
593+
594+
<!--
595+
This question should be filled when targeting a release.
596+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
597+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
598+
https://storage.googleapis.com/k8s-triage/index.html
599+
We expect no non-infra related flakes in the last month as a GA graduation criteria.
600+
-->
601+
602+
- A test using the CRI stats feature gate with enabled CRI implementations should be used with cri_stats_provider to ensure the stats reported are conformant.
603+
537604
### Graduation Criteria
538605
#### Alpha implementation
539606

540607
- CRI should be extended to provide required stats for `/stats/summary`
541608
- Kubelet should be extended to provide the required stats from CRI implementation for `/stats/summary`.
542609
- This new behavior will be gated by a feature gate to prevent regressions for users that rely on the old behavior.
610+
- cAdvisor should be able to optionally not report the metrics needed for both summary API and `/metrics/cadvisor`. This behavior will be toggled by the Kubelet feature gate.
611+
- Kubelet will query the CRI implementation for endpoints to broadcast from its own server.
612+
- This will allow the CRI to broadcast `/metrics/cadvisor` through the Kubelet's HTTP server.
543613

544614
#### Alpha -> Beta Graduation
545615

@@ -548,7 +618,6 @@ As a requirement for the Beta stage, cAdvisor must support optionally collecting
548618
- Validate performance impact of this feature is within allowable margin (or non-existent, ideally).
549619
- The CRI stats implementation should perform better than they did with CRI+cAdvisor.
550620
- cAdvisor stats provider may be marked as deprecated (depending on stability of new CRI based implementations).
551-
- cAdvisor should be able to optionally not report the metrics needed for both summary API and `/metrics/cadvisor`. This behavior will be toggled by the Kubelet feature gate.
552621

553622
#### Beta -> GA Graduation
554623

@@ -788,11 +857,13 @@ _This section must be completed when targeting beta graduation to a release._
788857

789858
## Implementation History
790859

791-
2021-1-27: KEP opened
792-
2021-5-12: KEP merged, targeted at Alpha in 1.22
793-
2021-7-8: KEP deemed not ready for Alpha in 1.22
860+
2021-01-27: KEP opened
861+
2021-05-12: KEP merged, targeted at Alpha in 1.22
862+
2021-07-08: KEP deemed not ready for Alpha in 1.22
794863
2021-12-07: KEP successfully implemented at Alpha in 1.23
795-
2022-1-25: KEP targeted at Beta in 1.24
864+
2022-01-25: KEP targeted at Beta in 1.24
865+
2022-04-20: KEP deemed not ready for Beta in 1.24
866+
2022-06-13: Move some Beta criteria to Alpha criteria in 1.25
796867

797868
## Drawbacks
798869

keps/sig-node/2371-cri-pod-container-stats/kep.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ approvers:
1616
prr-approvers:
1717
- "@ehashman"
1818
creation-date: 2021-01-27
19-
last-updated: 2022-01-25
19+
last-updated: 2022-06-13
2020
status: implementable
21-
stage: beta
22-
latest-milestone: "v1.24"
21+
stage: alpha
22+
latest-milestone: "v1.23"
2323
milestone:
2424
alpha: "v1.23"
25-
beta: "v1.24"
2625
see-also:
2726
- N/A
2827
replaces:

0 commit comments

Comments
 (0)