From c7231c8d6d0045bba24ea475f44e5daa3525df3c Mon Sep 17 00:00:00 2001 From: Swati Sehgal Date: Tue, 5 Oct 2021 21:08:43 +0100 Subject: [PATCH] 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 --- .../compute-storage-net/device-plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md index 6e766a86d6..f14f78b13b 100644 --- a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md +++ b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md @@ -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}