Skip to content

Commit a75c748

Browse files
committed
fix: Allow to deploy SR-IOV Device Plugin with SR-IOV Operator
We need to allow to deploy two instances of device plugins to allow run SR-IOV Network Operatro and use HostDeviceNetwork at the same time. Signed-off-by: Ivan Kolodiazhnyi <[email protected]>
1 parent 21bac8a commit a75c748

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

manifests/state-sriov-device-plugin/0010-sriov-dp-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
apiVersion: v1
1616
kind: ConfigMap
1717
metadata:
18-
name: sriovdp-config
18+
name: network-operator-sriovdp-config
1919
namespace: {{ .RuntimeSpec.Namespace }}
2020
data:
2121
config.json: '{{ .CrSpec.Config }}'

manifests/state-sriov-device-plugin/0020-sriov-dp-service-account.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
apiVersion: v1
1515
kind: ServiceAccount
1616
metadata:
17-
name: sriov-device-plugin
17+
name: network-operator-sriov-device-plugin
1818
namespace: {{ .RuntimeSpec.Namespace }}

manifests/state-sriov-device-plugin/0021_role.openshift.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
5-
name: sriov-device-plugin
5+
name: network-operator-sriov-device-plugin
66
namespace: {{ .RuntimeSpec.Namespace }}
77
rules:
88
- apiGroups:

manifests/state-sriov-device-plugin/0022_rolebinding.openshift.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: RoleBinding
44
metadata:
5-
name: sriov-device-plugin
5+
name: network-operator-sriov-device-plugin
66
namespace: {{ .RuntimeSpec.Namespace }}
77
roleRef:
88
apiGroup: rbac.authorization.k8s.io
99
kind: Role
10-
name: sriov-device-plugin
10+
name: network-operator-sriov-device-plugin
1111
subjects:
1212
- kind: ServiceAccount
13-
name: sriov-device-plugin
13+
name: network-operator-sriov-device-plugin
1414
{{end}}

manifests/state-sriov-device-plugin/0030-sriov-dp-daemonset.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
apiVersion: apps/v1
1515
kind: DaemonSet
1616
metadata:
17-
name: sriov-device-plugin
17+
name: network-operator-sriov-device-plugin
1818
namespace: {{ .RuntimeSpec.Namespace }}
1919
labels:
2020
tier: node
2121
app: sriovdp
2222
spec:
2323
selector:
2424
matchLabels:
25-
name: sriov-device-plugin
25+
name: network-operator-sriov-device-plugin
2626
template:
2727
metadata:
2828
labels:
29-
name: sriov-device-plugin
29+
name: network-operator-sriov-device-plugin
3030
tier: node
3131
app: sriovdp
3232
spec:
@@ -47,7 +47,7 @@ spec:
4747
- key: nvidia.com/gpu
4848
operator: Exists
4949
effect: NoSchedule
50-
serviceAccountName: sriov-device-plugin
50+
serviceAccountName: network-operator-sriov-device-plugin
5151
{{- if .CrSpec.ImagePullSecrets }}
5252
imagePullSecrets:
5353
{{- range .CrSpec.ImagePullSecrets }}
@@ -122,7 +122,7 @@ spec:
122122
type: DirectoryOrCreate
123123
- name: config-volume
124124
configMap:
125-
name: sriovdp-config
125+
name: network-operator-sriovdp-config
126126
items:
127127
- key: config.json
128128
path: config.json

pkg/state/state_sriov_dp_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("SR-IOV Device Plugin State tests", func() {
5353
By("Verify DaemonSet")
5454
ds := &appsv1.DaemonSet{}
5555
err = ts.client.Get(context.Background(), types.NamespacedName{Namespace: ts.namespace,
56-
Name: "sriov-device-plugin"}, ds)
56+
Name: "network-operator-sriov-device-plugin"}, ds)
5757
Expect(err).NotTo(HaveOccurred())
5858
assertCommonDaemonSetFields(ds, &cr.Spec.SriovDevicePlugin.ImageSpec, cr)
5959
// expect privileged mode
@@ -70,7 +70,7 @@ var _ = Describe("SR-IOV Device Plugin State tests", func() {
7070
By("Verify DaemonSet")
7171
ds := &appsv1.DaemonSet{}
7272
err = ts.client.Get(context.Background(), types.NamespacedName{Namespace: ts.namespace,
73-
Name: "sriov-device-plugin"}, ds)
73+
Name: "network-operator-sriov-device-plugin"}, ds)
7474
Expect(err).NotTo(HaveOccurred())
7575
assertCommonDaemonSetFields(ds, &cr.Spec.SriovDevicePlugin.ImageSpec, cr)
7676
// expect privileged mode
@@ -90,7 +90,7 @@ var _ = Describe("SR-IOV Device Plugin State tests", func() {
9090
By("Verify DaemonSet")
9191
ds := &appsv1.DaemonSet{}
9292
err = ts.client.Get(context.Background(), types.NamespacedName{Namespace: ts.namespace,
93-
Name: "sriov-device-plugin"}, ds)
93+
Name: "network-operator-sriov-device-plugin"}, ds)
9494
Expect(err).NotTo(HaveOccurred())
9595
assertCommonDaemonSetFields(ds, &cr.Spec.SriovDevicePlugin.ImageSpec, cr)
9696
assertSriovDpPodTemplatesVolumeFields(&ds.Spec.Template, false)
@@ -121,7 +121,7 @@ var _ = Describe("SR-IOV Device Plugin State tests", func() {
121121
By("Verify DaemonSet")
122122
ds := &appsv1.DaemonSet{}
123123
err = ts.client.Get(context.Background(), types.NamespacedName{Namespace: ts.namespace,
124-
Name: "sriov-device-plugin"}, ds)
124+
Name: "network-operator-sriov-device-plugin"}, ds)
125125
Expect(err).NotTo(HaveOccurred())
126126
assertCommonDaemonSetFields(ds, &cr.Spec.SriovDevicePlugin.ImageSpec, cr)
127127
assertSriovDpPodTemplatesVolumeFields(&ds.Spec.Template, false)
@@ -134,7 +134,7 @@ var _ = Describe("SR-IOV Device Plugin State tests", func() {
134134
By("Verify DaemonSet is deleted")
135135
ds = &appsv1.DaemonSet{}
136136
err = ts.client.Get(context.Background(), types.NamespacedName{Namespace: ts.namespace,
137-
Name: "sriov-device-plugin"}, ds)
137+
Name: "network-operator-sriov-device-plugin"}, ds)
138138
Expect(errors.IsNotFound(err)).To(BeTrue())
139139
})
140140
})
@@ -196,7 +196,7 @@ func assertSriovDpPodTemplatesVolumeFields(tpl *v1.PodTemplateSpec, useCdi bool)
196196
VolumeSource: v1.VolumeSource{
197197
ConfigMap: &v1.ConfigMapVolumeSource{
198198
LocalObjectReference: v1.LocalObjectReference{
199-
Name: "sriovdp-config",
199+
Name: "network-operator-sriovdp-config",
200200
},
201201
Items: []v1.KeyToPath{
202202
{

0 commit comments

Comments
 (0)