Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to select supported devices in the operator #599

Merged
merged 7 commits into from
Apr 12, 2021
Merged
Prev Previous commit
Next Next commit
operator: dsa: Add a kustomization overlay for DSA
Signed-off-by: Oleg Zhurakivskyy <[email protected]>
  • Loading branch information
ozhuraki committed Apr 8, 2021
commit de72b846b365716b08baa882904608cbf67cd177
14 changes: 14 additions & 0 deletions deployments/operator/device/dsa/dsa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: inteldeviceplugins-controller-manager
namespace: inteldeviceplugins-system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was the namespace required for this to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to omit it, however kustomize errors without namespace:

Error: no matches for IdId apps_v1_Deployment|~X|inteldeviceplugins-controller-manager; failed to find unique target for patch apps_v1_Deployment|inteldeviceplugins-controller-manager

spec:
template:
spec:
containers:
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
- --device=dsa
name: manager
5 changes: 5 additions & 0 deletions deployments/operator/device/dsa/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bases:
- ../../default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also pulls in ../../crd/bases which creates the CRDs for all devices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a way to drop the unneeded CRDs?

I tried with the approach to pick only specific CRDs (for example for FPGA), however couldn't get it to work:

diff --git a/deployments/operator/device/fpga/kustomization.yaml b/deployments/operator/device/fpga/kustomization.yaml
index cea26f2..60de267 100644
--- a/deployments/operator/device/fpga/kustomization.yaml
+++ b/deployments/operator/device/fpga/kustomization.yaml
@@ -1,5 +1,16 @@
+namespace: inteldeviceplugins-system
+namePrefix: inteldeviceplugins-
+
+resources:
+- deviceplugin.intel.com_fpgadeviceplugins.yaml
+- fpga.intel.com_acceleratorfunctions.yaml
+- fpga.intel.com_fpgaregions.yaml
+
 bases:
- - ../../default
+- ../../rbac
+- ../../manager
+- ../../webhook
+- ../../certmanager
 
 patchesStrategicMerge:
  - fpga.yaml
# kustomize build deployments/operator/device/fpga
Error: no matches for IdId apps_v1_Deployment|inteldeviceplugins-system|inteldeviceplugins-controller-manager; failed to find unique target for patch apps_v1_Deployment|inteldeviceplugins-controller-manager

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a way to drop the unneeded CRDs?

maybe the only way to do it is to have the CRDs created by the manager itself. This could follow the idea I demonstrate in #394 (comment)


patchesStrategicMerge:
- dsa.yaml