jdgue 发表于 2018-1-4 19:35:34

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】
https://images2017.cnblogs.com/blog/83241/201711/83241-20171114161923952-994281253.png
  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
页: [1]
查看完整版本: Kubernetes Device Plugins