intel-device-plugins-for-ku.../cmd/fpga_plugin
Dmitry Rozhkov 92f72e4196 fpga_plugin: indicate unhealthy devices
When the device's firmware crashes the OPAE driver reports all properties
of the device as a stream of binary ones. This effectively makes
interface and afu IDs look like "ffffffffffffffffffffffffffffffff".

Mark such devices as Unhealthy.

closes #77
2018-08-13 11:52:51 +03:00
..
fpga_plugin_test.go fpga_plugin: indicate unhealthy devices 2018-08-13 11:52:51 +03:00
fpga_plugin.go fpga_plugin: indicate unhealthy devices 2018-08-13 11:52:51 +03:00
README.md Merge branch 'master' into fpga-readme-edits 2018-07-31 13:18:40 -04:00

Build and test Intel FPGA device plugin for Kubernetes

Dependencies

You must install and set up the following FPGA plugin modules for correct operation:

Get source code:

$ mkdir -p $GOPATH/src/github.com/intel/
$ cd $GOPATH/src/github.com/intel/
$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes.git

Build FPGA device plugin:

$ cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
$ make fpga_plugin

Verify kubelet socket exists in /var/lib/kubelet/device-plugins/ directory:

$ ls /var/lib/kubelet/device-plugins/kubelet.sock
/var/lib/kubelet/device-plugins/kubelet.sock

Choose mode for FPGA device plugin

You can run the FPGA device plugin in either af or region mode.

Run FPGA device plugin in af mode

  1. Run FPGA device plugin as administrator:
$ export NODE_NAME="<node name>" # if the node's name was overridden and differs from hostname
$ sudo -E $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes/cmd/fpga_plugin/fpga_plugin -mode af -kubeconfig /var/run/kubernetes/admin.kubeconfig
FPGA device plugin started in af mode
device-plugin start server at: /var/lib/kubelet/device-plugins/fpga.intel.com-af-f7df405cbd7acf7222f144b0b93acd18.sock
device-plugin registered
  1. Check if FPGA device plugin is registered on master:
$ kubectl describe node <node name> | grep fpga.intel.com
 fpga.intel.com/af-f7df405cbd7acf7222f144b0b93acd18:  1
 fpga.intel.com/af-f7df405cbd7acf7222f144b0b93acd18:  1

Run FPGA device plugin in region mode

  1. Run FPGA device plugin as administrator:
$ export NODE_NAME="<node name>" # if the node's name was overridden and differs from hostname
$ sudo -E $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes/cmd/fpga_plugin/fpga_plugin -mode region -kubeconfig /var/run/kubernetes/admin.kubeconfig
FPGA device plugin started in region mode
device-plugin start server at: /var/lib/kubelet/device-plugins/fpga.intel.com-region-ce48969398f05f33946d560708be108a.sock
device-plugin registered
  1. Check if FPGA device plugin is registered on master:
$ kubectl describe node <node name> | grep fpga.intel.com
 fpga.intel.com/region-ce48969398f05f33946d560708be108a:  1
 fpga.intel.com/region-ce48969398f05f33946d560708be108a:  1

Deploy FPGA device plugin as DaemonSet

  1. To deploy the plugin in a production cluster, create a service account for the plugin:

    $ kubectl create -f deployments/fpga_plugin/fpga_plugin_service_account.yaml
    serviceaccount/intel-fpga-plugin-controller created
    clusterrole.rbac.authorization.k8s.io/node-getter created
    clusterrolebinding.rbac.authorization.k8s.io/get-nodes created
    
  2. Create the DaemonSet:

    $ kubectl create -f deployments/fpga_plugin/fpga_plugin.yaml
    daemonset.apps/intel-fpga-plugin created
    
  3. Build an image from sources:

    $ make intel-fpga-plugin
    

    This image launches fpga_plugin in af mode by default.

    You can override the mode on a per-node basis using this annotation:

    $ kubectl annotate node mynode "fpga.intel.com/device-plugin-mode=region"
    

    To use your own container image, modify the deployments/fpga_plugin/fpga_plugin.yaml file.

Next steps

Continue with FPGA admission controller webhook.