Kubernetes Device Plugins

The gRPC server that the device plugin must implement is expected to be advertised on a unix socket in a mounted hostPath

(e.g: /var/lib/kubelet/device-plugins/nvidiaGPU.sock).

Finally, to notify Kubelet of the existence of the device plugin,

the vendor's device plugin will have to make a request to Kubelet's own gRPC server【Kubelet Registry gRPC Server】

Only then will kubelet start interacting with the vendor's device plugin through the gRPC apis.

The device plugin is structured in 3 parts:

  • Registration: The device plugin advertises it's presence to Kubelet
  • ListAndWatch: The device plugin advertises a list of Devices to Kubelet and sends it again if the state of a Device changes
  • Allocate: When creating containers, Kubelet calls the device plugin's Allocate function

so that it can run device specific instructions (gpu cleanup, QRNG initialization, ...)

and instruct Kubelet how to make the device available in the container.

Device Plugins can expect to find the socket to register themselves on the host at the following path:/var/lib/kubelet/device-plugins/kubelet.sock

【Kubelet Registry gRPC Server】【Registry Method】【/var/lib/kubelet/device-plugins/kubelet.sock】

Device Plugins Refer:

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-management/device-plugin.md

https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-management/gpu-support.md

 

posted @ 2017-11-14 16:20  Edisonxiang  阅读(610)  评论(0编辑  收藏  举报