Skip to content

Commit

Permalink
Actuallize podresources description
Browse files Browse the repository at this point in the history
This commit updates description according to
kubernetes/enhancements#1884

Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>
  • Loading branch information
AlexeyPerevalov committed Oct 19, 2020
1 parent b8a8834 commit a928f22
Showing 1 changed file with 79 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,87 @@ The kubelet provides a gRPC service to enable discovery of in-use devices, and t
for these devices:

```gRPC
// PodResourcesLister is a service provided by the kubelet that provides information about the
// PodResources is a service provided by the kubelet that provides information about the
// node resources consumed by pods and containers on the node
service PodResourcesLister {
service PodResources {
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {}
rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {}
rpc Watch(WatchPodResourcesRequest) returns (stream WatchPodResourcesResponse) {}
}
```

List endpoint provides information on resources of running pods with details such as
id of exclusively allocated CPUs, device id as it was reported by device plugins and id of
NUMA node where these devices are allocated.

```gRPC
// ListPodResourcesResponse is the response returned by List function
message ListPodResourcesResponse {
repeated PodResources pod_resources = 1;
}
// PodResources contains information about the node resources assigned to a pod
message PodResources {
string name = 1;
string namespace = 2;
repeated ContainerResources containers = 3;
}
// ContainerResources contains information about the resources assigned to a container
message ContainerResources {
string name = 1;
repeated ContainerDevices devices = 2;
repeated int64 cpu_ids = 3;
}
// Topology describes hardware topology of the resource
message TopologyInfo {
repeated NUMANode nodes = 1;
}
// NUMA representation of NUMA node
message NUMANode {
int64 ID = 1;
}
// ContainerDevices contains information about the devices assigned to a container
message ContainerDevices {
string resource_name = 1;
repeated string device_ids = 2;
TopologyInfo topology = 3;
}
```

GetAllocatableResources provides information on resources initially available on the worker node.
It provides more information than kubelet exports to APIServer.

```gRPC
// AvailableResourcesResponses contains information about all the devices known by the kubelet
message AllocatableResourcesResponse {
repeated ContainerDevices devices = 1;
repeated int64 cpu_ids = 2;
}
```

Watch intends to quickly obtain information on a newly launched pod, the information obtained is the same
as obtained by List. By using Watch endpoint Monitoring agents do not need to call List periodically anymore.

```gRPC
// WatchPodResourcesRequest is the request made to the Watch PodResourcesLister service
message WatchPodResourcesRequest {}
enum WatchPodAction {
ADDED = 0;
DELETED = 1;
}
// WatchPodResourcesResponse is the response returned by Watch function
message WatchPodResourcesResponse {
WatchPodAction action = 1;
string uid = 2;
repeated PodResources pod_resources = 3;
}
```

Expand Down

0 comments on commit a928f22

Please sign in to comment.