Skip to content

Commit fade6bb

Browse files
authored
Merge pull request kubernetes#3791 from ffromani/kep-606-ga
KEP-606: finalize podresources API GA graduation
2 parents bf11b9b + 4b79572 commit fade6bb

File tree

3 files changed

+171
-45
lines changed

3 files changed

+171
-45
lines changed

keps/prod-readiness/sig-node/606.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kep-number: 606
2+
alpha:
3+
approver: "@deads2k"
4+
beta:
5+
approver: "@deads2k"
6+
stable:
7+
approver: "@deads2k"

keps/sig-node/606-compute-device-assignment/README.md

Lines changed: 161 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,34 @@
77
- [Summary](#summary)
88
- [Motivation](#motivation)
99
- [Goals](#goals)
10+
- [Non-Goals](#non-goals)
1011
- [Proposal](#proposal)
1112
- [User Stories](#user-stories)
13+
- [Story 1: Cluster administators: easier monitoring](#story-1-cluster-administators-easier-monitoring)
14+
- [Story 2: Device Vendors: decouple monitoring from device lifecycle management](#story-2-device-vendors-decouple-monitoring-from-device-lifecycle-management)
1215
- [Risks and Mitigations](#risks-and-mitigations)
1316
- [Design Details](#design-details)
1417
- [Proposed API](#proposed-api)
1518
- [Test Plan](#test-plan)
19+
- [Prerequisite testing updates](#prerequisite-testing-updates)
20+
- [Unit tests](#unit-tests)
21+
- [Integration tests](#integration-tests)
22+
- [e2e tests](#e2e-tests)
1623
- [Graduation Criteria](#graduation-criteria)
1724
- [Alpha](#alpha)
1825
- [Alpha to Beta Graduation](#alpha-to-beta-graduation)
1926
- [Beta to G.A Graduation](#beta-to-ga-graduation)
2027
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
2128
- [Version Skew Strategy](#version-skew-strategy)
2229
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
23-
- [Feature enablement and rollback](#feature-enablement-and-rollback)
30+
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
2431
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
25-
- [Monitoring requirements](#monitoring-requirements)
32+
- [Monitoring Requirements](#monitoring-requirements)
2633
- [Dependencies](#dependencies)
2734
- [Scalability](#scalability)
2835
- [Troubleshooting](#troubleshooting)
2936
- [Implementation History](#implementation-history)
37+
- [Drawbacks](#drawbacks)
3038
- [Alternatives](#alternatives)
3139
- [Add v1alpha1 Kubelet GRPC service, at <code>/var/lib/kubelet/pod-resources/kubelet.sock</code>, which returns a list of <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto#L734">CreateContainerRequest</a>s used to create containers.](#add-v1alpha1-kubelet-grpc-service-at--which-returns-a-list-of-createcontainerrequests-used-to-create-containers)
3240
- [Add a field to Pod Status.](#add-a-field-to-pod-status)
@@ -41,13 +49,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
4149
- [X] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements](https://github.com/kubernetes/enhancements/issues/606)
4250
- [X] (R) KEP approvers have approved the KEP status as `implementable`
4351
- [X] (R) Design details are appropriately documented
44-
- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
52+
- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
53+
- [X] e2e Tests for all Beta API Operations (endpoints)
54+
- [X] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
55+
- [X] (R) Minimum Two Week Window for GA e2e tests to prove flake free
4556
- [X] (R) Graduation criteria is in place
57+
- [X] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
4658
- [X] (R) Production readiness review completed
47-
- [X] Production readiness review approved
59+
- [X] (R) Production readiness review approved
4860
- [X] "Implementation History" section is up-to-date for milestone
49-
- ~~ [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] ~~
50-
- [X] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
61+
- [X] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
62+
- [X] Supporting documentatione.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
5163

5264
[kubernetes.io]: https://kubernetes.io/
5365
[kubernetes/enhancements]: https://git.k8s.io/enhancements
@@ -70,12 +82,21 @@ As such the external monitoring agents need to be able to determine the set of d
7082
* Deprecate and remove current device-specific knowledge from the kubelet, such as [accelerator metrics](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/stats/v1alpha1/types.go#L229)
7183
* Enable external device monitoring agents to provide metrics relevant to Kubernetes
7284

85+
### Non-Goals
86+
87+
* Enable cluster components to consume the API. The API is node-local only.
88+
7389
## Proposal
7490

7591
### User Stories
7692

77-
* As a _Cluster Administrator_, I provide a set of devices from various vendors in my cluster. Each vendor independently maintains their own agent, so I run monitoring agents only for devices I provide. Each agent adheres to to the [node monitoring guidelines](https://docs.google.com/document/d/1_CdNWIjPBqVDMvu82aJICQsSCbh2BR-y9a8uXjQm4TI/edit?usp=sharing), so I can use a compatible monitoring pipeline to collect and analyze metrics from a variety of agents, even though they are maintained by different vendors.
78-
* As a _Device Vendor_, I manufacture devices and I have deep domain expertise in how to run and monitor them. Because I maintain my own Device Plugin implementation, as well as Device Monitoring Agent, I can provide consumers of my devices an easy way to consume and monitor my devices without requiring open-source contributions. The Device Monitoring Agent doesn't have any dependencies on the Device Plugin, so I can decouple monitoring from device lifecycle management. My Device Monitoring Agent works by periodically querying the `/devices/<ResourceName>` endpoint to discover which devices are being used, and to get the container/pod metadata associated with the metrics:
93+
#### Story 1: Cluster administators: easier monitoring
94+
95+
As a _Cluster Administrator_, I provide a set of devices from various vendors in my cluster. Each vendor independently maintains their own agent, so I run monitoring agents only for devices I provide. Each agent adheres to to the [node monitoring guidelines](https://docs.google.com/document/d/1_CdNWIjPBqVDMvu82aJICQsSCbh2BR-y9a8uXjQm4TI/edit?usp=sharing), so I can use a compatible monitoring pipeline to collect and analyze metrics from a variety of agents, even though they are maintained by different vendors.
96+
97+
#### Story 2: Device Vendors: decouple monitoring from device lifecycle management
98+
99+
As a _Device Vendor_, I manufacture devices and I have deep domain expertise in how to run and monitor them. Because I maintain my own Device Plugin implementation, as well as Device Monitoring Agent, I can provide consumers of my devices an easy way to consume and monitor my devices without requiring open-source contributions. The Device Monitoring Agent doesn't have any dependencies on the Device Plugin, so I can decouple monitoring from device lifecycle management. My Device Monitoring Agent works by periodically querying the `/devices/<ResourceName>` endpoint to discover which devices are being used, and to get the container/pod metadata associated with the metrics:
79100

80101
![device monitoring architecture](https://user-images.githubusercontent.com/3262098/43926483-44331496-9bdf-11e8-82a0-14b47583b103.png)
81102

@@ -135,6 +156,10 @@ message ContainerDevices {
135156

136157
### Test Plan
137158

159+
[X] I/we understand the owners of the involved components may require updates to
160+
existing tests to make this code solid enough prior to committing the changes necessary
161+
to implement this enhancement.
162+
138163
Given that the API allows observing what device has been associated to what container, we need to be testing different configurations, such as:
139164
* Pods without devices assigned to any containers.
140165
* Pods with devices assigned to some but not all containers.
@@ -148,6 +173,20 @@ We have identified two main ways of testing this API:
148173
E2E tests are explicitly not written because they would require us to generate and deploy a custom container.
149174
The infrastructure required is expensive and it is not clear what additional testing (and hence risk reduction) this would provide compare to node e2e tests.
150175

176+
##### Prerequisite testing updates
177+
178+
##### Unit tests
179+
180+
- `k8s.io/kubernetes/pkg/kubelet/apis/podresources`: `20230127` - `61.5%`
181+
182+
##### Integration tests
183+
184+
covered by e2e tests
185+
186+
##### e2e tests
187+
188+
- `k8s.io/kubernetes/test/e2e_node/podresources_test.go`: https://storage.googleapis.com/k8s-triage/index.html?test=POD%20Resources
189+
151190
### Graduation Criteria
152191

153192
#### Alpha
@@ -179,60 +218,135 @@ Downgrades here are related to downgrading the plugin
179218
Kubelet will always be backwards compatible, so going forward existing plugins are not expected to break.
180219

181220
## Production Readiness Review Questionnaire
182-
### Feature enablement and rollback
183221

184-
* **How can this feature be enabled / disabled in a live cluster?**
185-
- [X] Feature gate (also fill in values in `kep.yaml`).
186-
- Feature gate name: `KubeletPodResources`.
187-
- Components depending on the feature gate: N/A.
222+
### Feature Enablement and Rollback
223+
224+
###### How can this feature be enabled / disabled in a live cluster?
225+
226+
- [X] Feature gate (also fill in values in `kep.yaml`)
227+
- Feature gate name: `KubeletPodResources`.
228+
- Components depending on the feature gate: N/A
188229

189-
* **Does enabling the feature change any default behavior?** No
190-
* **Can the feature be disabled once it has been enabled (i.e. can we rollback the enablement)?** Yes, through feature gates.
191-
* **What happens if we reenable the feature if it was previously rolled back?** The service recovers state from kubelet.
230+
###### Does enabling the feature change any default behavior?
231+
232+
No.
192233
* **Are there any tests for feature enablement/disablement?** No, however no data is created or deleted.
193234

235+
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
236+
237+
Yes, through feature gates.
238+
239+
###### What happens if we reenable the feature if it was previously rolled back?
240+
241+
The service recovers state from kubelet.
242+
243+
###### Are there any tests for feature enablement/disablement?
244+
245+
No, however no data is created or deleted.
246+
194247
### Rollout, Upgrade and Rollback Planning
195248

196-
* **How can a rollout fail? Can it impact already running workloads?** Kubelet would fail to start. Errors would be caught in the CI.
197-
* **What specific metrics should inform a rollback?** Not Applicable, metrics wouldn't be available.
198-
* **Were upgrade and rollback tested? Was upgrade->downgrade->upgrade path tested?** Not Applicable.
199-
* **Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?** No.
249+
###### How can a rollout or rollback fail? Can it impact already running workloads?
250+
251+
Kubelet would fail to start. Errors would be caught in the CI.
252+
253+
###### What specific metrics should inform a rollback?
254+
255+
Not Applicable, metrics wouldn't be available.
256+
257+
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
258+
259+
Not Applicable.
260+
261+
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
262+
263+
No.
200264

201-
### Monitoring requirements
202-
* **How can an operator determine if the feature is in use by workloads?**
203-
- Look at the `pod_resources_endpoint_requests_total` metric exposed by the kubelet.
204-
- Look at hostPath mounts of privileged containers.
205-
* **What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?**
206-
- [X] Metrics
207-
- Metric name: `pod_resources_endpoint_requests_total`
208-
- Components exposing the metric: kubelet
265+
### Monitoring Requirements
209266

210-
* **What are the reasonable SLOs (Service Level Objectives) for the above SLIs?** N/A or refer to Kubelet SLIs.
211-
* **Are there any missing metrics that would be useful to have to improve observability if this feature?** No.
267+
###### How can an operator determine if the feature is in use by workloads?
212268

269+
- Look at the `pod_resources_endpoint_requests_total` metric exposed by the kubelet.
270+
- Look at hostPath mounts of privileged containers.
271+
272+
###### How can someone using this feature know that it is working for their instance?
273+
274+
- [ ] Events
275+
- Event Reason:
276+
- [ ] API .status
277+
- Condition name:
278+
- Other field:
279+
- [X] Other (treat as last resort)
280+
- Details: check the kubelet metrics `pod_resources_endpoint_*`
281+
282+
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
283+
284+
N/A or refer to Kubelet SLIs.
285+
286+
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
287+
288+
- [X] Metrics
289+
- Metric name: `pod_resources_endpoint_requests_total`
290+
- Components exposing the metric: kubelet
291+
292+
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
293+
294+
No.
213295

214296
### Dependencies
215297

216-
* **Does this feature depend on any specific services running in the cluster?** Not aplicable.
298+
###### Does this feature depend on any specific services running in the cluster?
299+
300+
Not applicable.
217301

218302
### Scalability
219303

220-
* **Will enabling / using this feature result in any new API calls?** No.
221-
* **Will enabling / using this feature result in introducing new API types?** No.
222-
* **Will enabling / using this feature result in any new calls to cloud provider?** No.
223-
* **Will enabling / using this feature result in increasing size or count of the existing API objects?** No.
224-
* **Will enabling / using this feature result in increasing time taken by any operations covered by [existing SLIs/SLOs][]?** No. Feature is out of existing any paths in kubelet.
225-
* **Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?** In 1.18, DDOSing the API can lead to resource exhaustion. It is planned to be addressed as part of G.A.
304+
###### Will enabling / using this feature result in any new API calls?
305+
306+
No.
307+
308+
###### Will enabling / using this feature result in introducing new API types?
309+
310+
No.
311+
312+
###### Will enabling / using this feature result in any new calls to the cloud provider?
313+
314+
No.
315+
316+
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
317+
318+
No.
319+
320+
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
321+
322+
No. Feature is out of existing any paths in kubelet.
323+
324+
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
325+
326+
In 1.18, DDOSing the API can lead to resource exhaustion. It is planned to be addressed as part of G.A.
226327
Feature only collects data when requests comes in, data is then garbage collected. Data collected is proportional to the number of pods on the node.
227328

329+
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
330+
331+
No. Clients consume the API through the gRPC interface exposed from the unix domain socket. Only a single socket is created and managed by the kubelet,
332+
shared among all the clients (typically one). No resources are reserved when a client connects, and the API is stateless (no state preserved across
333+
calls, not concept of session). All the data needed to serve the calls is fetched by internal, already existing data structures internal to resource
334+
managers.
335+
228336
### Troubleshooting
229337

230-
* **How does this feature react if the API server and/or etcd is unavailable?**: No effect.
231-
* **What are other known failure modes?** No known failure modes
232-
* **What steps should be taken if SLOs are not being met to determine the problem?** N/A
233338

234-
[supported limits]: https://git.k8s.io/community//sig-scalability/configs-and-limits/thresholds.md
235-
[existing SLIs/SLOs]: https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos
339+
###### How does this feature react if the API server and/or etcd is unavailable?
340+
341+
No effect.
342+
343+
###### What are other known failure modes?
344+
345+
No known failure modes
346+
347+
###### What steps should be taken if SLOs are not being met to determine the problem?
348+
349+
N/A
236350

237351
## Implementation History
238352

@@ -243,6 +357,11 @@ Feature only collects data when requests comes in, data is then garbage collecte
243357
- 2019-04-30: Demo of production GPU monitoring by NVIDIA
244358
- 2019-04-30: Agreement in sig-node to move feature to beta in 1.15
245359
- 2020-06-17: Agreement in sig-node to move feature to G.A in 1.19 or 1.20
360+
- 2023-01-27: KEP translate to the most recent template
361+
362+
## Drawbacks
363+
364+
N/A
246365

247366
## Alternatives
248367

keps/sig-node/606-compute-device-assignment/kep.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors:
66
- "@renaudwastaken"
77
owning-sig: sig-node
88
participating-sigs: []
9-
status: implemented
9+
status: implementable
1010
creation-date: "2018-07-19"
1111
reviewers:
1212
- "@thockin"
@@ -24,13 +24,13 @@ stage: stable
2424
# The most recent milestone for which work toward delivery of this KEP has been
2525
# done. This can be the current (upcoming) milestone, if it is being actively
2626
# worked on.
27-
latest-milestone: "v1.20"
27+
latest-milestone: "v1.27"
2828

2929
# The milestone at which this feature was, or is targeted to be, at each stage.
3030
milestone:
3131
alpha: "v1.13"
3232
beta: "v1.15"
33-
stable: "v1.20"
33+
stable: "v1.27"
3434

3535
# The following PRR answers are required at alpha release
3636
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)