
PodResources client could be used by sriov cni to obtain devices allocated for container by sriov device-plugin. KubeletPodResources service is still in alpha, so it should be explicitly enabled in kubelet feature-gates: kubelet --feature-gates KubeletPodResources=true New config option 'kubelet_root_dir' added to 'sriov' section that defaults to kubelet default root-dir '/var/lib/kulelet'. In case kubelet started with non-default root directory passed via '--root-dir' option, the same value should be configured in 'kubelet_root_dir'. Note that if sriov binding driver will be used inside container 'kubelet_root_dir'/pod-resources directory should be mounted to this container in order to allow communication with kubelet via gRPC protocol over the unix domain socket. Partial-Bug: 1826865 Depends-On: https://review.openstack.org/#/c/652629 Change-Id: Icf088b839db079efe9c7647c31be4ead867ed32b Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
49 lines
1.8 KiB
Python
49 lines
1.8 KiB
Python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
import grpc
|
|
|
|
from kuryr_kubernetes.pod_resources import api_pb2 as kuryr__kubernetes_dot_pod__resources_dot_api__pb2
|
|
|
|
|
|
class PodResourcesListerStub(object):
|
|
"""PodResourcesLister is a service provided by the kubelet that provides information about the
|
|
node resources consumed by pods and containers on the node
|
|
"""
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.List = channel.unary_unary(
|
|
'/v1alpha1.PodResourcesLister/List',
|
|
request_serializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesRequest.SerializeToString,
|
|
response_deserializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesResponse.FromString,
|
|
)
|
|
|
|
|
|
class PodResourcesListerServicer(object):
|
|
"""PodResourcesLister is a service provided by the kubelet that provides information about the
|
|
node resources consumed by pods and containers on the node
|
|
"""
|
|
|
|
def List(self, request, context):
|
|
# missing associated documentation comment in .proto file
|
|
pass
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
|
|
def add_PodResourcesListerServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'List': grpc.unary_unary_rpc_method_handler(
|
|
servicer.List,
|
|
request_deserializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesRequest.FromString,
|
|
response_serializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesResponse.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'v1alpha1.PodResourcesLister', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|