Skip to content

Commit 1293ffc

Browse files
authored
Merge pull request #3915 from moshe010/pod-resources-api-update
PodResources API for DRA: match API with actual implementation in 1.27
2 parents 94257ed + 3e2ad56 commit 1293ffc

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

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

+15-7
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ This API is read-only, which removes a large class of risks. The aspects that we
9797
Our proposal is to extend the existing PodResources gRPC service of the Kubelet
9898
with a repeated `DynamicResource` field in the ContainerResources message. This
9999
new field will contain information about the DRA resource class, the DRA
100-
resource claim, and a list of CDI Devices allocated by a DRA driver.
100+
claim name, claim namespace, and a list of claimed resources allocated by a DRA driver.
101+
Currently, the claim resources only contain a list of CDI Devices but in the future they
102+
may be extended to support plugins that allocate different types of resource (not just CDI Devices).
101103
Additionally, we propose adding a `Get()` method to the existing gRPC service
102104
to allow querying specific pods for their allocated resources.
103105

@@ -178,7 +180,13 @@ message NUMANode {
178180
message DynamicResource {
179181
string class_name = 1;
180182
string claim_name = 2;
181-
repeated CDIDevice cdi_devices = 3;
183+
string claim_namespace = 3;
184+
repeated ClaimResource claim_resources = 4;
185+
}
186+
187+
// ClaimResource contains per plugin resource information
188+
message ClaimResource {
189+
repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"];
182190
}
183191
184192
// CDIDevice specifies a CDI device information
@@ -290,17 +298,17 @@ Kubelet will always be backwards compatible, so going forward existing plugins a
290298
enable / disable DRA feature.
291299
- Components depending on the feature gate: kube-apiserver, kube-controller-manager,
292300
kube-scheduler, kubelet
293-
- Feature gate name: `PodResourcesDynamicResources` new feature gate to
301+
- Feature gate name: `KubeletPodResourcesDynamicResources` new feature gate to
294302
enable / disable PodResources API List method to populate `DynamicResource`
295303
information from the `DRAManager`.
296304
`DynamicResourceAllocation` feature gate has to be enabled as well.
297305
- Components depending on the feature gate: kubelet, 3rd party consumers.
298-
- Feature gate name: `PodResourcesGet` new feature gate to enable / disable
306+
- Feature gate name: `KubeletPodResourcesGet` new feature gate to enable / disable
299307
PodResources API Get method. In case `DynamicResourceAllocation` or
300-
the `PodResourcesDynamicResources` are disabled and `PodResourcesGet`
308+
the `KubeletPodResourcesDynamicResources` are disabled and `KubeletPodResourcesGet`
301309
is enabled, the Get method will retrieve resources allocated by device plugins,
302310
memory and cpus (but omit those allocated by DRA resource drivers).
303-
In case `PodResourcesGet`, `DynamicResourceAllocation` and `PodResourcesDynamicResources`
311+
In case `KubeletPodResourcesGet`, `DynamicResourceAllocation` and `KubeletPodResourcesDynamicResources`
304312
are all enabled, the `Get()` method will also retrieve the resources allocated via DRA.
305313
- Components depending on the feature gate: kubelet, 3rd party consumers.
306314

@@ -328,7 +336,7 @@ Kubelet may fail to start. The new API may report inconsistent data, or may caus
328336

329337
###### What specific metrics should inform a rollback?
330338

331-
`pod_resources_endpoint_errors_get` - but only with feature gate `PodResourcesGet` enabled. Otherwise the API will always return a known error.
339+
`pod_resources_endpoint_errors_get` - but only with feature gate `KubeletPodResourcesGet` enabled. Otherwise the API will always return a known error.
332340

333341
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
334342

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ feature-gates:
4040
- kube-controller-manager
4141
- kube-scheduler
4242
- kubelet
43-
- name: PodResourcesDynamicResource
43+
- name: KubeletPodResourcesDynamicResource
4444
components:
4545
- kubelet
46-
- name: PodResourcesGet
46+
- name: KubeletPodResourcesGet
4747
components:
4848
- kubelet
4949
disable-supported: true

0 commit comments

Comments
 (0)