You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change necessary for resource with topology exporting daemon,
which used in topology aware scheduling.
Information about CPU is keeping in cpu_ids, since it's enough to
represent both quantity and numaid. NUMAid can be obtained from
cadvisor MachineInfo, since id in cpus_ids is a thread_id.
This API doesn't provide cpu fraction, since it could be obtainded from
Pod's request/limits and in case of non-integer CPU quantity and
non-guaranteed QoS cpu assigned is not exclusive and NUMA id is not
interesting.
Signed-off-by: Alexey Perevalov <[email protected]>
After this interface has been introduced it was used by CNI plugins like [kuryr-kubernetes](https://review.opendev.org/#/c/651580/) in couple with [intel-sriov-device-plugin](https://github.com/intel/sriov-network-device-plugin) to correctly define which devices were assigned to the pod.
64
+
65
+
### Topology aware scheduling
66
+
This interface can be used to collect allocated resources with information about the NUMA topology of the worker node. This information can then be used in NUMA aware scheduling.
60
67
61
68
## Changes
62
69
63
-
Add a v1alpha1 Kubelet GRPC service, at `/var/lib/kubelet/pod-resources/kubelet.sock`, which returns information about the kubelet's assignment of devices to containers. It obtains this information from the internal state of the kubelet's Device Manager. The GRPC Service returns a single PodResourcesResponse, which is shown in proto below:
70
+
Add a v1alpha1 Kubelet GRPC service, at `/var/lib/kubelet/pod-resources/kubelet.sock`, which returns information about the kubelet's assignment of devices and cpus to containers with NUMA id. It obtains this information from the internal state of the kubelet's Device Manager and CPU Manager respectively. The GRPC Service returns a single PodResourcesResponse, which is shown in proto below:
64
71
```protobuf
65
72
// PodResources is a service provided by the kubelet that provides information about the
66
73
// node resources consumed by pods and containers on the node
@@ -87,12 +94,14 @@ message PodResources {
87
94
message ContainerResources {
88
95
string name = 1;
89
96
repeated ContainerDevices devices = 2;
97
+
repeated uint32 cpu_ids = 3;
90
98
}
91
99
92
100
// ContainerDevices contains information about the devices assigned to a container
93
101
message ContainerDevices {
94
102
string resource_name = 1;
95
103
repeated string device_ids = 2;
104
+
uint32 numaid = 3;
96
105
}
97
106
```
98
107
@@ -113,7 +122,7 @@ message ContainerDevices {
113
122
* Notes:
114
123
* Does not include any reference to resource names. Monitoring agentes must identify devices by the device or environment variables passed to the pod or container.
115
124
116
-
### Add a field to Pod Status.
125
+
### Add a field to Pod Status.
117
126
* Pros:
118
127
* Allows for observation of container to device bindings local to the node through the `/pods` endpoint
119
128
* Cons:
@@ -148,7 +157,7 @@ type Container struct {
148
157
}
149
158
```
150
159
* During Kubelet pod admission, if `ComputeDevices` is found non-empty, specified devices will be allocated otherwise behaviour will remain same as it is today.
151
-
* Before starting the pod, the kubelet writes the assigned `ComputeDevices` back to the pod spec.
160
+
* Before starting the pod, the kubelet writes the assigned `ComputeDevices` back to the pod spec.
152
161
* Note: Writing to the Api Server and waiting to observe the updated pod spec in the kubelet's pod watch may add significant latency to pod startup.
153
162
* Allows devices to potentially be assigned by a custom scheduler.
154
163
* Serves as a permanent record of device assignments for the kubelet, and eliminates the need for the kubelet to maintain this state locally.
0 commit comments