Skip to content

Commit dff3e83

Browse files
AlexeyPerevalovffromani
authored andcommitted
Actuallize podresources description
This commit updates description according to kubernetes/enhancements#1884 Signed-off-by: Alexey Perevalov <[email protected]>
1 parent 9ae3e5c commit dff3e83

File tree

1 file changed

+56
-1
lines changed

1 file changed

+56
-1
lines changed

content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,64 @@ for these devices:
193193
// node resources consumed by pods and containers on the node
194194
service PodResourcesLister {
195195
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {}
196+
rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {}
196197
}
197198
```
198199

200+
List endpoint provides information on resources of running pods with details such as
201+
id of exclusively allocated CPUs, device id as it was reported by device plugins and id of
202+
NUMA node where these devices are allocated.
203+
204+
```gRPC
205+
// ListPodResourcesResponse is the response returned by List function
206+
message ListPodResourcesResponse {
207+
repeated PodResources pod_resources = 1;
208+
}
209+
210+
// PodResources contains information about the node resources assigned to a pod
211+
message PodResources {
212+
string name = 1;
213+
string namespace = 2;
214+
repeated ContainerResources containers = 3;
215+
}
216+
217+
// ContainerResources contains information about the resources assigned to a container
218+
message ContainerResources {
219+
string name = 1;
220+
repeated ContainerDevices devices = 2;
221+
repeated int64 cpu_ids = 3;
222+
}
223+
224+
// Topology describes hardware topology of the resource
225+
message TopologyInfo {
226+
repeated NUMANode nodes = 1;
227+
}
228+
229+
// NUMA representation of NUMA node
230+
message NUMANode {
231+
int64 ID = 1;
232+
}
233+
234+
// ContainerDevices contains information about the devices assigned to a container
235+
message ContainerDevices {
236+
string resource_name = 1;
237+
repeated string device_ids = 2;
238+
TopologyInfo topology = 3;
239+
}
240+
```
241+
242+
GetAllocatableResources provides information on resources initially available on the worker node.
243+
It provides more information than kubelet exports to APIServer.
244+
245+
```gRPC
246+
// AvailableResourcesResponses contains information about all the devices known by the kubelet
247+
message AllocatableResourcesResponse {
248+
repeated ContainerDevices devices = 1;
249+
repeated int64 cpu_ids = 2;
250+
}
251+
252+
```
253+
199254
The gRPC service is served over a unix socket at `/var/lib/kubelet/pod-resources/kubelet.sock`.
200255
Monitoring agents for device plugin resources can be deployed as a daemon, or as a DaemonSet.
201256
The canonical directory `/var/lib/kubelet/pod-resources` requires privileged access, so monitoring
@@ -204,7 +259,7 @@ DaemonSet, `/var/lib/kubelet/pod-resources` must be mounted as a
204259
{{< glossary_tooltip term_id="volume" >}} in the device monitoring agent's
205260
[PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
206261

207-
Support for the "PodResources service" requires `KubeletPodResources` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
262+
Support for the `PodResourcesLister service` requires `KubeletPodResources` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
208263
It is enabled by default starting with Kubernetes 1.15 and is v1 since Kubernetes 1.20.
209264

210265
## Device Plugin integration with the Topology Manager

0 commit comments

Comments
 (0)