Skip to content

Commit a845d4b

Browse files
authored
Merge pull request #669 from bart0sh/PR0108-mappings-doc
webhook: document mappings deployment
2 parents c51f087 + 8a54a9b commit a845d4b

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

cmd/fpga_admissionwebhook/README.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ Table of Contents
66
* [Dependencies](#dependencies)
77
* [Installation](#installation)
88
* [Pre-requisites](#pre-requisites)
9+
* [Mappings](#mappings)
910
* [Deployment](#deployment)
10-
* [Mappings](#mappings)
11+
* [Webhook deployment](#webhook-deployment)
12+
* [Mappings deployment](#mappings-deployment)
1113
* [Next steps](#next-steps)
1214

1315
## Introduction
@@ -96,25 +98,6 @@ set the cluster service names to `$no_proxy` before `kubeadm init`:
9698
$ export no_proxy=$no_proxy,.svc,.svc.cluster.local
9799
```
98100

99-
### Deployment
100-
101-
To deploy the webhook, run
102-
103-
```bash
104-
$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_admissionwebhook/default?ref=main
105-
namespace/intelfpgawebhook-system created
106-
customresourcedefinition.apiextensions.k8s.io/acceleratorfunctions.fpga.intel.com created
107-
customresourcedefinition.apiextensions.k8s.io/fpgaregions.fpga.intel.com created
108-
mutatingwebhookconfiguration.admissionregistration.k8s.io/intelfpgawebhook-mutating-webhook-configuration created
109-
clusterrole.rbac.authorization.k8s.io/intelfpgawebhook-manager-role created
110-
clusterrolebinding.rbac.authorization.k8s.io/intelfpgawebhook-manager-rolebinding created
111-
service/intelfpgawebhook-webhook-service created
112-
deployment.apps/intelfpgawebhook-webhook created
113-
certificate.cert-manager.io/intelfpgawebhook-serving-cert created
114-
issuer.cert-manager.io/intelfpgawebhook-selfsigned-issuer created
115-
```
116-
Now you can deploy your mappings.
117-
118101
## Mappings
119102

120103
Mappings is a an essential part of the setup that gives a flexible instrument to a cluster
@@ -158,18 +141,50 @@ Mappings of resource names are configured with objects of `AcceleratorFunction`
158141
[`./deployment/fpga_admissionwebhook/crd/bases/fpga.intel.com_af.yaml`](/deployments/fpga_admissionwebhook/crd/bases/fpga.intel.com_acceleratorfunctions.yaml)
159142
and [`./deployment/fpga_admissionwebhook/crd/bases/fpga.intel.com_region.yaml`](/deployments/fpga_admissionwebhook/crd/bases/fpga.intel.com_fpgaregions.yaml).
160143

161-
Mappings between 'names' and 'ID's are controlled by the admission controller
162-
mappings collection file found in
144+
Example mappings between 'names' and 'ID's are controlled by the admission controller mappings collection file found in
163145
[`./deployments/fpga_admissionwebhook/mappings-collection.yaml`](/deployments/fpga_admissionwebhook/mappings-collection.yaml).
164-
This mappings file can be deployed with
146+
147+
148+
### Deployment
149+
150+
#### Webhook deployment
151+
152+
To deploy the webhook, run
153+
154+
```bash
155+
$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/fpga_admissionwebhook/default?ref=main
156+
namespace/intelfpgawebhook-system created
157+
customresourcedefinition.apiextensions.k8s.io/acceleratorfunctions.fpga.intel.com created
158+
customresourcedefinition.apiextensions.k8s.io/fpgaregions.fpga.intel.com created
159+
mutatingwebhookconfiguration.admissionregistration.k8s.io/intelfpgawebhook-mutating-webhook-configuration created
160+
clusterrole.rbac.authorization.k8s.io/intelfpgawebhook-manager-role created
161+
clusterrolebinding.rbac.authorization.k8s.io/intelfpgawebhook-manager-rolebinding created
162+
service/intelfpgawebhook-webhook-service created
163+
deployment.apps/intelfpgawebhook-webhook created
164+
certificate.cert-manager.io/intelfpgawebhook-serving-cert created
165+
issuer.cert-manager.io/intelfpgawebhook-selfsigned-issuer created
166+
```
167+
168+
#### Mappings deployment
169+
170+
Mappings deployment is a mandatory part of the webhook deployment. You should
171+
prepare and deploy mappings that describe FPGA bitstreams available in your cluster.
172+
173+
Example mappings collection [`./deployments/fpga_admissionwebhook/mappings-collection.yaml`](/deployments/fpga_admissionwebhook/mappings-collection.yaml)
174+
can be used as an example for cluster mappings. This collection is not intended to be deployed as is,
175+
it should be used as a reference and example of your own cluster mappings.
176+
177+
To deploy the mappings, run
165178

166179
```bash
167-
$ kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/main/deployments/fpga_admissionwebhook/mappings-collection.yaml
180+
$ kubectl apply -f <path to mappings yaml>
181+
168182
```
169183

170184
Note that the mappings are scoped to the namespaces they were created in
171185
and they are applicable to pods created in the corresponding namespaces.
172186

187+
173188
## Next steps
174189

175-
Continue with [FPGA prestart CRI-O hook](../fpga_crihook/README.md).
190+
Continue with [FPGA prestart CRI-O hook](../fpga_crihook/README.md).

cmd/fpga_plugin/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Kubernetes:
6161
> **NOTE:** Installation of the [FPGA admission controller webhook](../fpga_admissionwebhook/README.md) can be skipped if the
6262
> FPGA device plugin is operated with the Intel Device Plugins Operator
6363
> since it integrates the controller's functionality.
64+
> However, [the mappings](../fpga_admissionwebhook/README.md#mappings-deployment) still must be deployed."
6465
6566
- [FPGA CRI-O prestart hook](../fpga_crihook/README.md)
6667

0 commit comments

Comments
 (0)