|
11 | 11 | * [Getting the source code](#getting-the-source-code)
|
12 | 12 | * [Verify node kubelet config](#verify-node-kubelet-config)
|
13 | 13 | * [Deploying as a DaemonSet](#deploying-as-a-daemonset)
|
14 |
| - * [Create a service account](#create-a-service-account) |
15 |
| - * [Deploying `region` mode](#deploying-region-mode) |
16 |
| - * [Deploying `af` mode](#deploying-af-mode) |
17 |
| - * [Deploy the DaemonSet](#deploy-the-daemonset) |
18 | 14 | * [Verify plugin registration](#verify-plugin-registration)
|
19 | 15 | * [Building the plugin image](#building-the-plugin-image)
|
20 | 16 | * [Deploy by hand](#deploy-by-hand)
|
21 | 17 | * [Build FPGA device plugin](#build-fpga-device-plugin)
|
22 | 18 | * [Run FPGA device plugin in af mode](#run-fpga-device-plugin-in-af-mode)
|
23 | 19 | * [Run FPGA device plugin in region mode](#run-fpga-device-plugin-in-region-mode)
|
24 |
| -* [Next steps](#next-steps) |
25 | 20 |
|
26 | 21 | # Introduction
|
27 | 22 |
|
@@ -177,82 +172,83 @@ $ ls /var/lib/kubelet/device-plugins/kubelet.sock
|
177 | 172 |
|
178 | 173 | ## Deploying as a DaemonSet
|
179 | 174 |
|
180 |
| -You can deploy the plugin in either of the modes, using the |
181 |
| -[DaemonSet YAML](../../deployments/fpga_plugin/fpga_plugin.yaml) |
182 |
| -supplied. Details are in the following sections. Actions common to both deployment modes are detailed |
183 |
| -first. Mode specific actions are then detailed. |
| 175 | +As a pre-requisite you need to have [cert-manager](https://cert-manager.io) |
| 176 | +up and running: |
184 | 177 |
|
185 |
| -If you intend to deploy your own image, you will need to reference the |
186 |
| -[image build section](#build-the-plugin-image) first. |
187 |
| - |
188 |
| -If you do not want to deploy the `devel` tagged image, you will need to edit the |
189 |
| -YAML deployment files to reference your required image. |
190 |
| - |
191 |
| -### For beta testing: new deployment model |
192 |
| - |
193 |
| -The FPGA plugin deployment is currently being rewritten to enable |
194 |
| -straight-forward deployment of both `af` and |
195 |
| -`region` modes. The deployment has two steps: |
| 178 | +```bash |
| 179 | +$ kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.1/cert-manager.yaml |
| 180 | +$ kubectl get pods -n cert-manager |
| 181 | +NAME READY STATUS RESTARTS AGE |
| 182 | +cert-manager-7747db9d88-bd2nl 1/1 Running 0 1m |
| 183 | +cert-manager-cainjector-87c85c6ff-59sb5 1/1 Running 0 1m |
| 184 | +cert-manager-webhook-64dc9fff44-29cfc 1/1 Running 0 1m |
196 | 185 |
|
197 |
| -1. Run `scripts/fpga-plugin-prepare-for-kustomization.sh`. This will |
198 |
| - create the necessary secrets: a key and a signed certificate for |
199 |
| - the FPGA admission controller. |
| 186 | +``` |
200 | 187 |
|
201 |
| -2. Depending on the FPGA mode, run either |
202 |
| - ```bash |
203 |
| - $ kubectl create -k deployments/fpga_plugin/overlays/af |
204 |
| - ``` |
205 |
| - or |
206 |
| - ```bash |
207 |
| - $ kubectl create -k deployments/fpga_plugin/overlays/region |
208 |
| - ``` |
209 |
| - This will create the service account and deploy |
210 |
| - both the FPGA plugin and the admission controller in the chosen mode. |
| 188 | +Depending on the FPGA mode, run either |
| 189 | +```bash |
| 190 | +$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/af |
| 191 | +namespace/intelfpgaplugin-system created |
| 192 | +customresourcedefinition.apiextensions.k8s.io/acceleratorfunctions.fpga.intel.com created |
| 193 | +customresourcedefinition.apiextensions.k8s.io/fpgaregions.fpga.intel.com created |
| 194 | +mutatingwebhookconfiguration.admissionregistration.k8s.io/intelfpgaplugin-mutating-webhook-configuration created |
| 195 | +clusterrole.rbac.authorization.k8s.io/intelfpgaplugin-manager-role created |
| 196 | +clusterrole.rbac.authorization.k8s.io/intelfpgaplugin-node-getter created |
| 197 | +clusterrolebinding.rbac.authorization.k8s.io/intelfpgaplugin-get-nodes created |
| 198 | +clusterrolebinding.rbac.authorization.k8s.io/intelfpgaplugin-manager-rolebinding created |
| 199 | +service/intelfpgaplugin-webhook-service created |
| 200 | +deployment.apps/intelfpgaplugin-webhook created |
| 201 | +daemonset.apps/intelfpgaplugin-fpgadeviceplugin created |
| 202 | +certificate.cert-manager.io/intelfpgaplugin-serving-cert created |
| 203 | +issuer.cert-manager.io/intelfpgaplugin-selfsigned-issuer created |
| 204 | +``` |
| 205 | +or |
| 206 | +```bash |
| 207 | +$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_plugin/overlays/region |
| 208 | +namespace/intelfpgaplugin-system created |
| 209 | +customresourcedefinition.apiextensions.k8s.io/acceleratorfunctions.fpga.intel.com created |
| 210 | +customresourcedefinition.apiextensions.k8s.io/fpgaregions.fpga.intel.com created |
| 211 | +mutatingwebhookconfiguration.admissionregistration.k8s.io/intelfpgaplugin-mutating-webhook-configuration created |
| 212 | +clusterrole.rbac.authorization.k8s.io/intelfpgaplugin-manager-role created |
| 213 | +clusterrole.rbac.authorization.k8s.io/intelfpgaplugin-node-getter created |
| 214 | +clusterrolebinding.rbac.authorization.k8s.io/intelfpgaplugin-get-nodes created |
| 215 | +clusterrolebinding.rbac.authorization.k8s.io/intelfpgaplugin-manager-rolebinding created |
| 216 | +service/intelfpgaplugin-webhook-service created |
| 217 | +deployment.apps/intelfpgaplugin-webhook created |
| 218 | +daemonset.apps/intelfpgaplugin-fpgadeviceplugin created |
| 219 | +certificate.cert-manager.io/intelfpgaplugin-serving-cert created |
| 220 | +issuer.cert-manager.io/intelfpgaplugin-selfsigned-issuer created |
| 221 | +``` |
| 222 | +The command should result in two pods running: |
| 223 | +```bash |
| 224 | +$ kubectl get pods -n intelfpgaplugin-system |
| 225 | +NAME READY STATUS RESTARTS AGE |
| 226 | +intelfpgaplugin-fpgadeviceplugin-skcw5 1/1 Running 0 57s |
| 227 | +intelfpgaplugin-webhook-7d6bcb8b57-k52b9 1/1 Running 0 57s |
| 228 | +``` |
211 | 229 |
|
212 |
| -This deployment model is under development. The remaining part of this |
213 |
| -document goes through the current deployment model: here for the |
214 |
| -FPGA plugin and in the next document for the FPGA admission controller. |
| 230 | +If you intend to deploy your own image, you will need to reference the |
| 231 | +[image build section](#build-the-plugin-image) first. |
215 | 232 |
|
216 |
| -### Create a service account |
| 233 | +If you do not want to deploy the `devel` or release tagged image, you will need to create your |
| 234 | +own kustomization overlay referencing your required image. |
217 | 235 |
|
218 |
| -To deploy the plugin in a production cluster, create a service account |
219 |
| -for the plugin: |
| 236 | +If you need the FPGA plugin on some nodes to operate in a different mode then add this |
| 237 | +annotation to the nodes: |
220 | 238 |
|
221 | 239 | ```bash
|
222 |
| -$ kubectl create -f deployments/fpga_plugin/fpga_plugin_service_account.yaml |
223 |
| -serviceaccount/intel-fpga-plugin-controller created |
224 |
| -clusterrole.rbac.authorization.k8s.io/node-getter created |
225 |
| -clusterrolebinding.rbac.authorization.k8s.io/get-nodes created |
| 240 | +$ kubectl annotate node <node_name> 'fpga.intel.com/device-plugin-mode=region' |
226 | 241 | ```
|
227 |
| - |
228 |
| -### Deploying `region` mode |
229 |
| - |
230 |
| -To deploy the FPGA plugin DaemonSet in `region` mode, you need to set the plugin |
231 |
| -mode annotation on all of your nodes, otherwise the FPGA plugin will run in its default |
232 |
| -`af` mode. |
233 |
| - |
| 242 | +or |
234 | 243 | ```bash
|
235 |
| -$ kubectl annotate node --all 'fpga.intel.com/device-plugin-mode=region' |
| 244 | +$ kubectl annotate node <node_name> 'fpga.intel.com/device-plugin-mode=af' |
236 | 245 | ```
|
| 246 | +And restart the pods on the nodes. |
237 | 247 |
|
238 |
| -### Deploying `af` mode |
239 |
| - |
240 |
| -To deploy the FPGA plugin DaemonSet in `af` mode, you do not need to set the mode annotation on |
241 |
| -your nodes, as the FPGA plugin runs in `af` mode by default. |
242 |
| - |
243 |
| -> **Note:** The FPGA plugin [DaemonSet YAML](../../deployments/fpga_plugin/fpga_plugin.yaml) |
| 248 | +> **Note:** The FPGA plugin [DaemonSet YAML](../../deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml) |
244 | 249 | > also deploys the [FPGA CRI-O hook](../fpga_criohook) `initcontainer` image, but it will be
|
245 | 250 | > benign (un-used) when running the FPGA plugin in `af` mode.
|
246 | 251 |
|
247 |
| -### Deploy the DaemonSet |
248 |
| - |
249 |
| -You can then use the example DaemonSet YAML file provided to deploy the plugin. |
250 |
| - |
251 |
| -```bash |
252 |
| -$ kubectl create -f deployments/fpga_plugin/fpga_plugin.yaml |
253 |
| -daemonset.apps/intel-fpga-plugin created |
254 |
| -``` |
255 |
| - |
256 | 252 | ### Verify plugin registration
|
257 | 253 |
|
258 | 254 | Verify the FPGA plugin has been deployed on the nodes. The below shows the output
|
@@ -288,8 +284,8 @@ Successfully tagged intel/intel-fpga-plugin:devel
|
288 | 284 |
|
289 | 285 | This image launches `fpga_plugin` in `af` mode by default.
|
290 | 286 |
|
291 |
| -To use your own container image, modify the |
292 |
| -[`deployments/fpga_plugin/fpga_plugin.yaml`](../../deployments/fpga_plugin/fpga_plugin.yaml) |
| 287 | +To use your own container image, create you own kustomization overlay patching |
| 288 | +[`deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml`](../../deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml) |
293 | 289 | file.
|
294 | 290 |
|
295 | 291 | ## Deploy by hand
|
@@ -337,6 +333,3 @@ FPGA device plugin started in region mode
|
337 | 333 | device-plugin start server at: /var/lib/kubelet/device-plugins/fpga.intel.com-region-ce48969398f05f33946d560708be108a.sock
|
338 | 334 | device-plugin registered
|
339 | 335 | ```
|
340 |
| -# Next steps |
341 |
| - |
342 |
| -Continue installation with the [FPGA admission controller webhook](../fpga_admissionwebhook/README.md). |
0 commit comments