Skip to content

Commit 4748330

Browse files
authored
Merge pull request #4913 from ArangoGutierrez/KEP-3695
KEP-3695: Update podResourceV1 API
2 parents 1be89a9 + 683affc commit 4748330

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

keps/sig-node/3695-pod-resources-for-dra/README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
6161

6262
## Summary
6363

64-
We propose an enhancement to the PodResources API to include resources allocated by [Dynamic Resource Allocation (DRA)](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/3063-dynamic-resource-allocation). We also propose to extend the API to be more friendly for consumption by CNI meta-plugins.
64+
We propose an enhancement to the PodResources API to include resources allocated by [Dynamic Resource Allocation (DRA)](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/3063-dynamic-resource-allocation).
6565
This KEP extends [2043-pod-resource-concrete-assigments](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2043-pod-resource-concrete-assigments) and [2403-pod-resources-allocatable-resources](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2403-pod-resources-allocatable-resources).
6666

6767
## Motivation
6868

69-
One of the primary motivations for this KEP is to extend the PodResources API to allow node monitoring agents to access information about resources allocated by DRA. The PodResources API is also being used by CNI meta-plugins like [multus](https://github.com/k8snetworkplumbingwg/multus-cni) and [DANM](https://github.com/nokia/danm) to add resources allocated by device plugins as CNI arguments. This extension can be used to allow these CNI plugins to reference resources allocated by DRA as well. Additional extensions to the API will also make it easier for CNI meta-plugins to access resources allocated to a specific pod, rather than having to filter through resources for all pods on the node.
69+
One of the primary motivations for this KEP is to extend the PodResources API to allow node monitoring agents to access information about resources allocated by DRA.
7070

7171
### Goals
7272

7373
- To allow node monitoring agents to know the allocated DRA resources for Pods on a node.
74-
- To allow the DRA feature to work with CNIs that require complex network devices such as RDMA. DRA resource drivers will allocate the resources, and the meta-plugin will read the allocated [CDI Devices](https://github.com/container-orchestrated-devices/container-device-interface) using the PodResources API. The meta-plugin will then inject the device-id of these CDI Devices as CNI arguments and invoke other CNIs (just as it does for devices allocated by the device plugin today).
74+
- To allow node components to use the PodResourcesAPI to use the DRA information to develop new features and integrations.
7575

7676
### Non-Goals
7777

@@ -110,6 +110,7 @@ retrieve PodResources from, rather than having to query all of them all at
110110
once.
111111

112112
The full PodResources API (including our proposed extensions) can be seen below:
113+
113114
```protobuf
114115
// PodResourcesLister is a service provided by the kubelet that provides information about the
115116
// node resources consumed by pods and containers on the node
@@ -159,7 +160,7 @@ message ContainerMemory {
159160
TopologyInfo topology = 3;
160161
}
161162
162-
// ContainerDevices contains information about the devices assigned to a container by device plugin
163+
// ContainerDevices contains information about the devices assigned to a container
163164
message ContainerDevices {
164165
string resource_name = 1;
165166
repeated string device_ids = 2;
@@ -178,15 +179,22 @@ message NUMANode {
178179
179180
// DynamicResource contains information about the devices assigned to a container by DRA
180181
message DynamicResource {
181-
string class_name = 1;
182+
// tombstone: removed in 1.31 because claims are no longer associated with one class
183+
// string class_name = 1;
182184
string claim_name = 2;
183185
string claim_namespace = 3;
184186
repeated ClaimResource claim_resources = 4;
185187
}
186188
187-
// ClaimResource contains per plugin resource information
189+
// ClaimResource contains resource information. The driver name/pool name/device name
190+
// triplet uniquely identifies the device. Should DRA get extended to other kinds
191+
// of resources, then device_name will be empty and other fields will get added.
192+
// Each device at the DRA API level may map to zero or more CDI devices.
188193
message ClaimResource {
189194
repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"];
195+
string driver_name = 2;
196+
string pool_name = 3;
197+
string device_name = 4;
190198
}
191199
192200
// CDIDevice specifies a CDI device information
@@ -200,8 +208,8 @@ message CDIDevice {
200208
201209
// GetPodResourcesRequest contains information about the pod
202210
message GetPodResourcesRequest {
203-
string name = 1;
204-
string namespace = 2;
211+
string pod_name = 1;
212+
string pod_namespace = 2;
205213
}
206214
207215
// GetPodResourcesResponse contains information about the pod the devices
@@ -241,7 +249,7 @@ restarts).
241249

242250
##### Unit tests
243251

244-
- `k8s.io/kubernetes/pkg/kubelet/apis/podresources`: `01-24-2023` - `61.5%`
252+
- `k8s.io/kubernetes/pkg/kubelet/apis/podresources`: `10-08-2024` - `75.3%`
245253

246254
##### Integration tests
247255

@@ -261,12 +269,12 @@ These cases will be added in the existing e2e tests:
261269

262270
#### Alpha
263271

264-
- [ ] Feature implemented behind a feature flag.
265-
- [ ] e2e tests completed and enabled.
272+
- [x] Feature implemented behind a feature flag. (https://github.com/kubernetes/kubernetes/pull/115847)
273+
- [x] e2e tests completed and enabled. (https://github.com/kubernetes/kubernetes/pull/116846)
266274

267275
#### Beta
268276

269-
- [ ] Gather feedback from consumers of the DRA feature and k8snetworkplumbingwg working group
277+
- [ ] Gather feedback from consumers of the DRA feature.
270278
- [ ] No major bugs reported in the previous cycle.
271279

272280
#### GA
@@ -287,7 +295,6 @@ To a vendor changes in the API should always be backwards compatible.
287295

288296
Kubelet will always be backwards compatible, so going forward existing plugins are not expected to break.
289297

290-
291298
## Production Readiness Review Questionnaire
292299
### Feature Enablement and Rollback
293300

@@ -429,6 +436,8 @@ N/A.
429436

430437
- 2023-01-12: KEP created
431438

439+
- 2024-09-10: KEP Updated to reflect the current state of the implementation.
440+
432441
## Drawbacks
433442

434443
## Alternatives

keps/sig-node/3695-pod-resources-for-dra/kep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ latest-milestone: "v1.27"
2828
# The milestone at which this feature was, or is targeted to be, at each stage.
2929
milestone:
3030
alpha: "v1.27"
31-
beta: "v1.30"
32-
stable: "v1.32"
31+
beta: "v1.33"
32+
stable: "v1.36"
3333

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

0 commit comments

Comments
 (0)