Explicitly state that GetCpuIds returns exclusive cpus

Based on the discussion here: https://github.com/kubernetes/kubernetes/pull/97415#discussion_r722548437
we explictly state that the GetCpuIds returned for a ContainerResource in the ListPodResourcesResponse
represent only exclusively allocated CPUs.

In order to evaluate the CPUs corresponding to the shared pool, List endpoint should be used in conjunction
with GetAllocatableResources endpoint. We highlight the steps that the client needs to take evaluate this.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
Swati Sehgal 2021-10-05 21:08:43 +01:00
parent 8d6da01857
commit c7231c8d6d
1 changed files with 9 additions and 0 deletions

View File

@ -248,6 +248,15 @@ message ContainerDevices {
TopologyInfo topology = 3;
}
```
{{< note >}}
cpu_ids in the `ContainerResources` in the `List` endpoint correspond to exclusive CPUs allocated
to a partilar container. If the goal is to evaluate CPUs that belong to the shared pool, the `List`
endpoint needs to be used in conjunction with the `GetAllocatableResources` endpoint as explained
below:
1. Call `GetAllocatableResources` to get a list of all the allocatable CPUs
2. Call `GetCpuIds` on all `ContainerResources` in the system
3. Subtract out all of the CPUs from the `GetCpuIds` calls from the `GetAllocatableResources` call
{{< /note >}}
### `GetAllocatableResources` gRPC endpoint {#grpc-endpoint-getallocatableresources}