mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Edits to FPGA readme files for format and text flow.
Signed-off-by: MCamp859 <mary.camp@ptiglobal.net>
This commit is contained in:
parent
5bb12f515a
commit
a29e04f614
@ -1,13 +1,22 @@
|
||||
## Build and install Intel FPGA webhook for admission controller
|
||||
# Build and install Intel FPGA webhook for admission controller
|
||||
|
||||
### Get source code
|
||||
### Dependencies
|
||||
|
||||
You must install and set up the following FPGA plugin modules for correct operation:
|
||||
|
||||
- [FPGA device plugin](cmd/fpga_plugin/README.md)
|
||||
- [FPGA admission controller webhook](cmd/fpga_admissionwebhook/README.md) (this module)
|
||||
- [FPGA prestart CRI-O hook](cmd/fpga_crihook/README.md)
|
||||
|
||||
### 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 a Docker image with the webhook
|
||||
|
||||
### Build a Docker image with the webhook:
|
||||
```
|
||||
$ export SRC=$GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
|
||||
$ cd $SRC
|
||||
$ make intel-fpga-admissionwebhook
|
||||
@ -16,12 +25,13 @@
|
||||
intel-fpga-admissionwebhook 10efe163a5091e8b2ceaa9baad236d3a41063c88 6c3bce0b8693 0 sec ago 25.2MB
|
||||
intel-fpga-admissionwebhook devel 6c3bce0b8693 0 sec ago 25.2MB
|
||||
...
|
||||
```
|
||||
|
||||
### Deploy webhook service
|
||||
|
||||
Make sure you have `cfssl` and `jq` utilities installed on your host.
|
||||
Then run the script `scripts/webhook-deploy.sh`.
|
||||
### Deploy webhook service:
|
||||
|
||||
Verify that the `cfssl` and `jq` utilities are installed on your host.
|
||||
Run the `scripts/webhook-deploy.sh` script.
|
||||
```
|
||||
$ cd $SRC
|
||||
$ ./scripts/webhook-deploy.sh
|
||||
Create secret including signed key/cert pair for the webhook
|
||||
@ -38,20 +48,25 @@ Then run the script `scripts/webhook-deploy.sh`.
|
||||
service "intel-fpga-webhook-svc" created
|
||||
Register webhook
|
||||
mutatingwebhookconfiguration "fpga-mutator-webhook-cfg" created
|
||||
```
|
||||
|
||||
By default the script deploys the webhook in the preprogrammed mode (when
|
||||
requested FPGA resources get translated to AF resources, e.g.
|
||||
"intel.com/fpga-arria10-nlb0" -> "intel.com/fpga-af-d8424dc4a4a3c413f89e433683f9040b").
|
||||
You can command the script to deploy the webhook in the orchestrated mode with
|
||||
the option `--mode`.
|
||||
By default, the script deploys the webhook in a preprogrammed mode. Requested FPGA resources are translated to AF resources. For example,
|
||||
`intel.com/fpga-arria10-nlb0` is translated to `intel.com/fpga-af-d8424dc4a4a3c413f89e433683f9040b`.
|
||||
|
||||
Use the option `--mode` to command the script to deploy the webhook in orchestrated mode:
|
||||
```
|
||||
$ ./scripts/webhook-deploy.sh --mode orchestrated
|
||||
```
|
||||
|
||||
Please note that the script needs the CA bundle used for signing cerificate
|
||||
requests in your cluster. By default it fetches the bundle stored
|
||||
in the configmap `extension-apiserver-authentication`. But it may differ from
|
||||
the actual signing cerificate which is passed in the option
|
||||
`--cluster-signing-cert-file` to `kube-controller-manager`. In this case
|
||||
you need to point the script to the actual signing cerificate:
|
||||
|
||||
Note that the script needs the CA bundle used for signing certificate
|
||||
requests in your cluster. By default, the script fetches the bundle stored
|
||||
in the configmap `extension-apiserver-authentication`. However, your cluster may use a different signing certificate that is passed in the option
|
||||
`--cluster-signing-cert-file` to `kube-controller-manager`. In this case,
|
||||
you must point the script to the actual signing certificate as follows:
|
||||
```
|
||||
$ ./scripts/webhook-deploy.sh --ca-bundle-path /var/run/kubernetes/server-ca.crt
|
||||
```
|
||||
|
||||
### Next steps
|
||||
|
||||
Continue with [FPGA prestart CRI-O hook](cmd/fpga_crihook/README.md).
|
||||
|
@ -1,24 +1,32 @@
|
||||
# Build and setup prestart CRI-O hook
|
||||
# Build and set up Intel FPGA prestart CRI-O hook
|
||||
|
||||
### Get source code
|
||||
### Dependencies
|
||||
|
||||
You must install and set up the following FPGA plugin modules for correct operation:
|
||||
|
||||
- [FPGA device plugin](cmd/fpga_plugin/README.md)
|
||||
- [FPGA admission controller webhook](cmd/fpga_admissionwebhook/README.md)
|
||||
- [FPGA prestart CRI-O hook](cmd/fpga_crihook/README.md) (this module)
|
||||
|
||||
### 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 CRI-O hook
|
||||
### Build CRI-O hook:
|
||||
```
|
||||
$ cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
|
||||
$ make fpga_crihook
|
||||
```
|
||||
|
||||
### Install CRI-O hook
|
||||
### Install CRI-O hook:
|
||||
```
|
||||
$ sudo cp cmd/fpga_crihook/fpga_crihook /usr/local/bin/
|
||||
```
|
||||
|
||||
### Configure CRI-O to run the hook
|
||||
### Configure CRI-O to run the hook:
|
||||
```
|
||||
$ sudo cat << EOF > /etc/containers/oci/hooks.d/prestart.json
|
||||
{
|
||||
|
@ -1,27 +1,40 @@
|
||||
# Build and test Intel FPGA Device Plugin for Kubernetes
|
||||
# Build and test Intel FPGA device plugin for Kubernetes
|
||||
|
||||
### Get source code
|
||||
### Dependencies
|
||||
|
||||
You must install and set up the following FPGA plugin modules for correct operation:
|
||||
|
||||
- [FPGA device plugin](cmd/fpga_plugin/README.md) (this module)
|
||||
- [FPGA admission controller webhook](cmd/fpga_admissionwebhook/README.md)
|
||||
- [FPGA prestart CRI-O hook](cmd/fpga_crihook/README.md)
|
||||
|
||||
|
||||
### 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
|
||||
### Build FPGA device plugin:
|
||||
```
|
||||
$ cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
|
||||
$ make fpga_plugin
|
||||
```
|
||||
|
||||
### Make sure kubelet socket exists in /var/lib/kubelet/device-plugins/
|
||||
### 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 afu or region mode.
|
||||
|
||||
#### Run FPGA device plugin in afu mode
|
||||
|
||||
##### Run FPGA device plugin as administrator
|
||||
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
|
||||
@ -30,7 +43,7 @@ device-plugin start server at: /var/lib/kubelet/device-plugins/intel-fpga-af-f7d
|
||||
device-plugin registered
|
||||
```
|
||||
|
||||
##### Check if FPGA device plugin is registered on master
|
||||
2. Check if FPGA device plugin is registered on master:
|
||||
```
|
||||
$ kubectl describe node <node name> | grep intel.com/fpga
|
||||
intel.com/fpga-af-f7df405cbd7acf7222f144b0b93acd18: 1
|
||||
@ -39,7 +52,7 @@ $ kubectl describe node <node name> | grep intel.com/fpga
|
||||
|
||||
#### Run FPGA device plugin in region mode
|
||||
|
||||
##### Run FPGA device plugin as administrator
|
||||
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
|
||||
@ -48,7 +61,7 @@ device-plugin start server at: /var/lib/kubelet/device-plugins/intel-fpga-region
|
||||
device-plugin registered
|
||||
```
|
||||
|
||||
##### Check if FPGA device plugin is registered on master
|
||||
2. Check if FPGA device plugin is registered on master:
|
||||
```
|
||||
$ kubectl describe node <node name> | grep intel.com/fpga
|
||||
intel.com/fpga-region-ce48969398f05f33946d560708be108a: 1
|
||||
@ -57,26 +70,35 @@ $ kubectl describe node <node name> | grep intel.com/fpga
|
||||
|
||||
### Deploy FPGA device plugin as DaemonSet
|
||||
|
||||
To deploy the plugin in a production cluster create a service account
|
||||
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
|
||||
```
|
||||
|
||||
Then create the DaemonSet itself
|
||||
|
||||
2. Create the DaemonSet:
|
||||
```
|
||||
$ kubectl create -f deployments/fpga_plugin/fpga_plugin.yaml
|
||||
daemonset.apps/intel-fpga-plugin created
|
||||
```
|
||||
|
||||
You may want to modify the file `deployments/fpga_plugin/fpga_plugin.yaml` to
|
||||
use your own container image. But the command
|
||||
|
||||
3. Build an image from sources:
|
||||
```
|
||||
$ make intel-fpga-plugin
|
||||
```
|
||||
This image launches `fpga_plugin` in the `af` mode by default.
|
||||
|
||||
can provide an image built from the sources. This image launches `fpga_plugin`
|
||||
in the `af` mode by default. The mode can be overriden on per node basis with
|
||||
this node annotation:
|
||||
|
||||
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](cmd/fpga_admissionwebhook/README.md).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user