Skip to content

Commit 97bcecd

Browse files
committed
operator: update usage guidelines
As the operator container image is available from a registry, we should guide users to use it rather than build and deploy it locally. Further, drop (un)deploy-operator targets in favor of simply using kubectl for deployment. Signed-off-by: Mikko Ylinen <[email protected]>
1 parent 60f23f4 commit 97bcecd

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

DEVEL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,17 @@ $ make test
179179

180180
and fix all new compilation issues.
181181

182-
## How to publish a new version of the Intel Device Plugins operator
182+
## How to work with Intel Device Plugins operator modifications
183+
184+
There are few useful steps when working with changes to Device Plugins CRDs and controllers:
185+
186+
1. Install controller-gen: `GO111MODULE=on go get -u sigs.k8s.io/controller-tools/cmd/controller-gen@<release ver>, e.g, v0.4.1`
187+
2. Generate CRD and Webhook artifacts: `make generate`
188+
3. Test local changes using [envtest](https://book.kubebuilder.io/reference/envtest.html): `make envtest`
189+
4. Build a custom operator image: `make intel-deviceplugin-operator`
190+
5. (Un)deploy operator: `kubectl [apply|delete] -k deployments/operator/default`
191+
192+
## How to publish a new version of the Intel Device Plugins operator to operatorhub.io
183193

184194
Generate package manifests with:
185195
```

Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ $(cmds):
9999

100100
build: $(cmds)
101101

102-
deploy-operator: operator generate
103-
kubectl apply -k deployments/operator/default
104-
105-
undeploy-operator:
106-
kubectl delete -k deployments/operator/default
107-
108-
run-operator: deploy-operator
109-
./cmd/operator/operator
110-
111102
.PHONY: bundle
112103
bundle:
113104
$(OPERATOR_SDK) generate kustomize manifests -q --input-dir $(OLM_MANIFESTS) --output-dir $(OLM_MANIFESTS) --apis-dir pkg/apis
@@ -173,7 +164,7 @@ check-github-actions:
173164
jq -e '$(images_json) - .jobs.image.strategy.matrix.image == []' > /dev/null || \
174165
(echo "Make sure all images are listed in .github/workflows/ci.yaml"; exit 1)
175166

176-
.PHONY: all format test lint build images $(cmds) $(images) lock-images vendor pre-pull set-version check-github-actions run-operator envtest deploy-operator undeploy-operator
167+
.PHONY: all format test lint build images $(cmds) $(images) lock-images vendor pre-pull set-version check-github-actions envtest
177168

178169
SPHINXOPTS =
179170
SPHINXBUILD = sphinx-build

README.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -173,30 +173,14 @@ The [DSA device plugin](cmd/dsa_plugin/README.md) supports acceleration using th
173173

174174
## Device Plugins Operator
175175

176-
Currently the operator has support for the QAT, GPU, FPGA, SGX and DSA device plugins:
177-
it validates container image references and extends reported statuses.
176+
To simplify the deployment of the device plugins, a unified device plugins operator is implemented.
178177

179-
To run an operator instance in the container run
178+
Currently the operator has support for the QAT, GPU, FPGA, SGX and DSA device plugins. Each
179+
device plugin has its own custom resource definition (CRD) and the corresponding controller that
180+
watches CRUD operations to those custom resources.
180181

181-
```bash
182-
$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.2.0/cert-manager.yaml
183-
$ make deploy-operator
184-
```
185-
186-
Then deploy your device plugin by applying its custom resource, e.g.
187-
`GpuDevicePlugin` with
188-
189-
```bash
190-
$ kubectl apply -f ./deployments/operator/samples/deviceplugin_v1_gpudeviceplugin.yaml
191-
```
192-
193-
Observe it is up and running:
194-
195-
```bash
196-
$ kubectl get GpuDevicePlugin
197-
NAME DESIRED READY NODE SELECTOR AGE
198-
gpudeviceplugin-sample 1 1 5s
199-
```
182+
The [Device plugins operator README](cmd/operator/README.md) gives the installation and usage
183+
details. The operator is also available via [operatorhub.io](https://operatorhub.io/operator/intel-device-plugins-operator).
200184

201185
## Demos
202186

cmd/operator/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,29 @@ $ export no_proxy=$no_proxy,.svc,.svc.cluster.local
7575
Finally deploy the operator itself:
7676

7777
```
78-
$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/operator/default?ref=main
78+
$ kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/operator/default?ref=<RELEASE_VERSION>
7979
```
8080

8181
Now you can deploy the device plugins by creating corresponding custom resources.
8282
The samples for them are available [here](/deployments/operator/samples/).
8383

84+
## Usage
85+
86+
Deploy your device plugin by applying its custom resource, e.g.
87+
`GpuDevicePlugin` with
88+
89+
```bash
90+
$ kubectl apply -f https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/operator/samples/deviceplugin_v1_gpudeviceplugin.yaml
91+
```
92+
93+
Observe it is up and running:
94+
95+
```bash
96+
$ kubectl get GpuDevicePlugin
97+
NAME DESIRED READY NODE SELECTOR AGE
98+
gpudeviceplugin-sample 1 1 5s
99+
```
100+
84101
## Known issues
85102

86103
When the operator is run with leader election enabled, that is with the option

0 commit comments

Comments
 (0)