From 7ea35d0cd88d22fffda4b7bdf3b1dcc4627d9c92 Mon Sep 17 00:00:00 2001 From: Swati Sehgal Date: Fri, 23 Dec 2022 18:50:42 +0000 Subject: [PATCH] node: device-mgr: sample device plugin: manifest to avoid registration Signed-off-by: Swati Sehgal --- test/e2e/testing-manifests/embed.go | 2 +- ...le-device-plugin-control-registration.yaml | 52 +++++++++++++++++++ .../sample-device-plugin.yaml | 0 test/e2e_node/util_sampledevice.go | 3 +- 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml rename test/e2e/testing-manifests/{ => sample-device-plugin}/sample-device-plugin.yaml (100%) diff --git a/test/e2e/testing-manifests/embed.go b/test/e2e/testing-manifests/embed.go index a763b2fc87c..bc0e9070fc9 100644 --- a/test/e2e/testing-manifests/embed.go +++ b/test/e2e/testing-manifests/embed.go @@ -22,7 +22,7 @@ import ( e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles" ) -//go:embed cluster-dns flexvolume guestbook kubectl sample-device-plugin.yaml scheduling/nvidia-driver-installer.yaml statefulset storage-csi +//go:embed cluster-dns flexvolume guestbook kubectl sample-device-plugin scheduling/nvidia-driver-installer.yaml statefulset storage-csi var e2eTestingManifestsFS embed.FS func GetE2ETestingManifestsFS() e2etestfiles.EmbeddedFileSource { diff --git a/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml b/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml new file mode 100644 index 00000000000..54cf07c46e7 --- /dev/null +++ b/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: sample-device-plugin-beta + namespace: kube-system + labels: + k8s-app: sample-device-plugin +spec: + selector: + matchLabels: + k8s-app: sample-device-plugin + template: + metadata: + labels: + k8s-app: sample-device-plugin + annotations: + spec: + priorityClassName: system-node-critical + tolerations: + - operator: "Exists" + effect: "NoExecute" + - operator: "Exists" + effect: "NoSchedule" + volumes: + - name: device-plugin + hostPath: + path: /var/lib/kubelet/device-plugins + - name: plugins-registry-probe-mode + hostPath: + path: /var/lib/kubelet/plugins_registry + - name: dev + hostPath: + path: /dev + containers: + - image: registry.k8s.io/e2e-test-images/sample-device-plugin:1.5 + name: sample-device-plugin + env: + - name: PLUGIN_SOCK_DIR + value: "/var/lib/kubelet/device-plugins" + - name: REGISTER_CONTROL_FILE + value: "/var/lib/kubelet/device-plugins/sample/registration" + securityContext: + privileged: true + volumeMounts: + - name: device-plugin + mountPath: /var/lib/kubelet/device-plugins + - name: plugins-registry-probe-mode + mountPath: /var/lib/kubelet/plugins_registry + - name: dev + mountPath: /dev + updateStrategy: + type: RollingUpdate diff --git a/test/e2e/testing-manifests/sample-device-plugin.yaml b/test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin.yaml similarity index 100% rename from test/e2e/testing-manifests/sample-device-plugin.yaml rename to test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin.yaml diff --git a/test/e2e_node/util_sampledevice.go b/test/e2e_node/util_sampledevice.go index a1e22ee761e..eca7418164c 100644 --- a/test/e2e_node/util_sampledevice.go +++ b/test/e2e_node/util_sampledevice.go @@ -22,7 +22,8 @@ import ( const ( // SampleDevicePluginDSYAML is the path of the daemonset template of the sample device plugin. // TODO: Parametrize it by making it a feature in TestFramework. - SampleDevicePluginDSYAML = "test/e2e/testing-manifests/sample-device-plugin.yaml" + SampleDevicePluginDSYAML = "test/e2e/testing-manifests/sample-device-plugin.yaml" + SampleDevicePluginControlRegistrationDSYAML = "test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml" // SampleDevicePluginName is the name of the device plugin pod SampleDevicePluginName = "sample-device-plugin"