Skip to content

Commit b4f485a

Browse files
ffromaniAlexeyPerevalovTim Bannister
authored
Actualize podresources 1.21 (#27203)
* Actuallize podresources description This commit updates description according to kubernetes/enhancements#1884 Update content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md Signed-off-by: Alexey Perevalov <[email protected]> Co-authored-by: Tim Bannister <[email protected]> * podresources: document the new feature gate Signed-off-by: Francesco Romani <[email protected]> * device plugins: add clarifications after review - fix the AllocatableResourcesResponse comment - describe the NUMA ID and explain the meaning of the field. Signed-off-by: Francesco Romani <[email protected]> Co-authored-by: Alexey Perevalov <[email protected]> Co-authored-by: Tim Bannister <[email protected]>
1 parent f9bacb2 commit b4f485a

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

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

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,69 @@ 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+
The `List` endpoint provides information on resources of running pods, with details such as the
201+
id of exclusively allocated CPUs, device id as it was reported by device plugins and id of
202+
the 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+
// AllocatableResourcesResponses contains informations 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+
254+
`ContainerDevices` do expose the topology information declaring to which NUMA cells the device is affine.
255+
The NUMA cells are identified using a opaque integer ID, which value is consistent to what device
256+
plugins report [when they register themselves to the kubelet](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager).
257+
258+
199259
The gRPC service is served over a unix socket at `/var/lib/kubelet/pod-resources/kubelet.sock`.
200260
Monitoring agents for device plugin resources can be deployed as a daemon, or as a DaemonSet.
201261
The canonical directory `/var/lib/kubelet/pod-resources` requires privileged access, so monitoring
@@ -204,7 +264,7 @@ DaemonSet, `/var/lib/kubelet/pod-resources` must be mounted as a
204264
{{< glossary_tooltip term_id="volume" >}} in the device monitoring agent's
205265
[PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
206266

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

210270
## Device Plugin integration with the Topology Manager
@@ -256,5 +316,3 @@ Here are some examples of device plugin implementations:
256316
* Learn about [advertising extended resources](/docs/tasks/administer-cluster/extended-resource-node/) on a node
257317
* Read about using [hardware acceleration for TLS ingress](https://kubernetes.io/blog/2019/04/24/hardware-accelerated-ssl/tls-termination-in-ingress-controllers-using-kubernetes-device-plugins-and-runtimeclass/) with Kubernetes
258318
* Learn about the [Topology Manager](/docs/tasks/administer-cluster/topology-manager/)
259-
260-

content/en/docs/reference/command-line-tools-reference/feature-gates.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ different Kubernetes components.
137137
| `LocalStorageCapacityIsolation` | `true` | Beta | 1.10 | |
138138
| `LocalStorageCapacityIsolationFSQuotaMonitoring` | `false` | Alpha | 1.15 | |
139139
| `LogarithmicScaleDown` | `false` | Alpha | 1.21 | |
140+
| `KubeletPodResourcesGetAllocatable` | `false` | Alpha | 1.21 | |
140141
| `MixedProtocolLBService` | `false` | Alpha | 1.20 | |
141142
| `NamespaceDefaultLabelName` | `true` | Beta | 1.21 | |
142143
| `NetworkPolicyEndPort` | `false` | Alpha | 1.21 | |
@@ -675,6 +676,9 @@ Each feature gate is designed for enabling/disabling a specific feature:
675676
- `KubeletPodResources`: Enable the kubelet's pod resources gRPC endpoint. See
676677
[Support Device Monitoring](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/606-compute-device-assignment/README.md)
677678
for more details.
679+
- `KubeletPodResourcesGetAllocatable`: Enable the kubelet's pod resources `GetAllocatableResources` functionality.
680+
This API augments the [resource allocation reporting](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources)
681+
with informations about the allocatable resources, enabling clients to properly track the free compute resources on a node.
678682
- `LegacyNodeRoleBehavior`: When disabled, legacy behavior in service load balancers and
679683
node disruption will ignore the `node-role.kubernetes.io/master` label in favor of the
680684
feature-specific labels provided by `NodeDisruptionExclusion` and `ServiceNodeExclusion`.

0 commit comments

Comments
 (0)