|
| 1 | +# Intel DSA device plugin for Kubernetes |
| 2 | + |
| 3 | +Table of Contents |
| 4 | + |
| 5 | +* [Introduction](#introduction) |
| 6 | +* [Installation](#installation) |
| 7 | + * [Deploy with pre-built container image](#deploy-with-pre-built-container-image) |
| 8 | + * [Getting the source code](#getting-the-source-code) |
| 9 | + * [Verify node kubelet config](#verify-node-kubelet-config) |
| 10 | + * [Deploying as a DaemonSet](#deploying-as-a-daemonset) |
| 11 | + * [Build the plugin image](#build-the-plugin-image) |
| 12 | + * [Deploy plugin DaemonSet](#deploy-plugin-daemonset) |
| 13 | + * [Deploy by hand](#deploy-by-hand) |
| 14 | + * [Build the plugin](#build-the-plugin) |
| 15 | + * [Run the plugin as administrator](#run-the-plugin-as-administrator) |
| 16 | + * [Verify plugin registration](#verify-plugin-registration) |
| 17 | + |
| 18 | +## Introduction |
| 19 | + |
| 20 | +The DSA device plugin for Kubernetes supports acceleration using the Intel Data Streaming accelerator(DSA). |
| 21 | + |
| 22 | +The DSA plugin discovers DSA work queues and presents them as a node resources. |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +The following sections detail how to obtain, build, deploy and test the DSA device plugin. |
| 27 | + |
| 28 | +Examples are provided showing how to deploy the plugin either using a DaemonSet or by hand on a per-node basis. |
| 29 | + |
| 30 | +### Deploy with pre-built container image |
| 31 | + |
| 32 | +[Pre-built images](https://hub.docker.com/r/intel/intel-dsa-plugin) |
| 33 | +of this component are available on the Docker hub. These images are automatically built and uploaded |
| 34 | +to the hub from the latest master branch of this repository. |
| 35 | + |
| 36 | +Release tagged images of the components are also available on the Docker hub, tagged with their |
| 37 | +release version numbers in the format `x.y.z`, corresponding to the branches and releases in this |
| 38 | +repository. Thus the easiest way to deploy the plugin in your cluster is to run this command |
| 39 | + |
| 40 | +```bash |
| 41 | +$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/dsa_plugin?ref=<REF> |
| 42 | +daemonset.apps/intel-dsa-plugin created |
| 43 | +``` |
| 44 | + |
| 45 | +Where `<REF>` needs to be substituted with the desired git ref, e.g. `master`. |
| 46 | + |
| 47 | +Nothing else is needed. But if you want to deploy a customized version of the plugin read further. |
| 48 | + |
| 49 | +### Getting the source code |
| 50 | + |
| 51 | +```bash |
| 52 | +$ export INTEL_DEVICE_PLUGINS_SRC=/path/to/intel-device-plugins-for-kubernetes |
| 53 | +$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes ${INTEL_DEVICE_PLUGINS_SRC} |
| 54 | +``` |
| 55 | + |
| 56 | +### Verify node kubelet config |
| 57 | + |
| 58 | +Every node that will be running the dsa plugin must have the |
| 59 | +[kubelet device-plugins](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/) |
| 60 | +configured. For each node, check that the kubelet device plugin socket exists: |
| 61 | + |
| 62 | +```bash |
| 63 | +$ ls /var/lib/kubelet/device-plugins/kubelet.sock |
| 64 | +/var/lib/kubelet/device-plugins/kubelet.sock |
| 65 | +``` |
| 66 | + |
| 67 | +### Deploying as a DaemonSet |
| 68 | + |
| 69 | +To deploy the dsa plugin as a daemonset, you first need to build a container image for the |
| 70 | +plugin and ensure that is visible to your nodes. |
| 71 | + |
| 72 | +#### Build the plugin image |
| 73 | + |
| 74 | +The following will use `docker` to build a local container image called |
| 75 | +`intel/intel-dsa-plugin` with the tag `devel`. |
| 76 | + |
| 77 | +The image build tool can be changed from the default `docker` by setting the `BUILDER` argument |
| 78 | +to the [`Makefile`](Makefile). |
| 79 | + |
| 80 | +```bash |
| 81 | +$ cd ${INTEL_DEVICE_PLUGINS_SRC} |
| 82 | +$ make intel-dsa-plugin |
| 83 | +... |
| 84 | +Successfully tagged intel/intel-dsa-plugin:devel |
| 85 | +``` |
| 86 | + |
| 87 | +#### Deploy plugin DaemonSet |
| 88 | + |
| 89 | +You can then use the [example DaemonSet YAML](/deployments/dsa_plugin/base/intel-dsa-plugin.yaml) |
| 90 | +file provided to deploy the plugin. The default kustomization that deploys the YAML as is: |
| 91 | + |
| 92 | +```bash |
| 93 | +$ kubectl apply -k deployments/dsa_plugin |
| 94 | +daemonset.apps/intel-dsa-plugin created |
| 95 | +``` |
| 96 | + |
| 97 | +### Deploy by hand |
| 98 | + |
| 99 | +For development purposes, it is sometimes convenient to deploy the plugin 'by hand' on a node. |
| 100 | +In this case, you do not need to build the complete container image, and can build just the plugin. |
| 101 | + |
| 102 | +#### Build the plugin |
| 103 | + |
| 104 | +First we build the plugin: |
| 105 | + |
| 106 | +```bash |
| 107 | +$ cd ${INTEL_DEVICE_PLUGINS_SRC} |
| 108 | +$ make dsa_plugin |
| 109 | +``` |
| 110 | + |
| 111 | +#### Run the plugin as administrator |
| 112 | + |
| 113 | +Now we can run the plugin directly on the node: |
| 114 | + |
| 115 | +```bash |
| 116 | +$ sudo -E ${INTEL_DEVICE_PLUGINS_SRC}/cmd/dsa_plugin/dsa_plugin |
| 117 | +device-plugin registered |
| 118 | +``` |
| 119 | + |
| 120 | +### Verify plugin registration |
| 121 | + |
| 122 | +You can verify the plugin has been registered with the expected nodes by searching for the relevant |
| 123 | +resource allocation status on the nodes: |
| 124 | + |
| 125 | +```bash |
| 126 | +$ kubectl get nodes -o=jsonpath="{range .items[*]}{.metadata.name}{'\n'}{' i915: '}{.status.allocatable.dsa\.intel\.com/*}{'\n'}" |
| 127 | +master |
| 128 | + dsa.intel.com/wq-user-dedicated: 1 |
| 129 | + dsa.intel.com/wq-user-shared: 1 |
| 130 | +``` |
0 commit comments