GitHub: Intel Device plugins for Kubernetes

Device Plugins

Device Plugins

Use the Kubernetes device plugin framework to implement plugins for GPUs, NICs, FPGAs, InfiniBand, and similar resources that require vendor-specific setup.

Instead of customizing the code for Kubernetes itself, vendors can implements a device plugin that you deploy either manually or as a DaemonSet. The targeted device include GPUs, high-performance NICs, FPGAs, InfiniBand adapters, and other similar computing resources that may require vendor specific initialization and setup.

Device plugin registration

The kubelet exports a Registration RPC service:

1service Registration{
2    rpc Register(RegisterRequest) return (Empty){}
3}

Then, user can request devices in a Container specification as they request other types of resources, with the following limitations:

  • Extended resources are only supported as integer resources and cannot be overcommitted.
  • Devices cannot be shared among Containers.

Here is an example of a pod requesting this resource to run a demo workload.

 1---
 2apiVersion: v1
 3kind: Pod
 4metaData:
 5	name: demo-pod
 6spec:
 7	containers:
 8	- name: demo-container-1
 9	  images: k8s.gcr.io/pause:2.0
10	  resource:
11	  	limit:
12	  		hardware-vendor.example/foo: 2
13# This Pod need 2 of the hardware-vendor.example/foo devices and can only schedule onto a Node
14# that's able to satisfy the need.
15# If the Node has more than 2 of those device avaiable, the remainder would be available for 
16# other Pods to use.