@@ -45,6 +45,7 @@ import (
45
45
"k8s.io/klog"
46
46
api "k8s.io/kubernetes/pkg/apis/core"
47
47
"k8s.io/kubernetes/test/e2e/framework"
48
+ e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest"
48
49
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
49
50
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
50
51
e2epv "k8s.io/kubernetes/test/e2e/framework/pv"
@@ -222,7 +223,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
222
223
addGpuNodePool (gpuPoolName , gpuType , 1 , 0 )
223
224
defer deleteNodePool (gpuPoolName )
224
225
225
- installNvidiaDriversDaemonSet (f . Namespace . Name )
226
+ installNvidiaDriversDaemonSet (f )
226
227
227
228
ginkgo .By ("Enable autoscaler" )
228
229
framework .ExpectNoError (enableAutoscaler (gpuPoolName , 0 , 1 ))
@@ -249,7 +250,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
249
250
addGpuNodePool (gpuPoolName , gpuType , 1 , 1 )
250
251
defer deleteNodePool (gpuPoolName )
251
252
252
- installNvidiaDriversDaemonSet (f . Namespace . Name )
253
+ installNvidiaDriversDaemonSet (f )
253
254
254
255
ginkgo .By ("Schedule a single pod which requires GPU" )
255
256
framework .ExpectNoError (ScheduleAnySingleGpuPod (f , "gpu-pod-rc" ))
@@ -279,7 +280,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
279
280
addGpuNodePool (gpuPoolName , gpuType , 1 , 0 )
280
281
defer deleteNodePool (gpuPoolName )
281
282
282
- installNvidiaDriversDaemonSet (f . Namespace . Name )
283
+ installNvidiaDriversDaemonSet (f )
283
284
284
285
ginkgo .By ("Enable autoscaler" )
285
286
framework .ExpectNoError (enableAutoscaler (gpuPoolName , 0 , 1 ))
@@ -308,7 +309,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
308
309
addGpuNodePool (gpuPoolName , gpuType , 1 , 1 )
309
310
defer deleteNodePool (gpuPoolName )
310
311
311
- installNvidiaDriversDaemonSet (f . Namespace . Name )
312
+ installNvidiaDriversDaemonSet (f )
312
313
313
314
ginkgo .By ("Schedule a single pod which requires GPU" )
314
315
framework .ExpectNoError (ScheduleAnySingleGpuPod (f , "gpu-pod-rc" ))
@@ -999,10 +1000,18 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
999
1000
})
1000
1001
})
1001
1002
1002
- func installNvidiaDriversDaemonSet (namespace string ) {
1003
+ func installNvidiaDriversDaemonSet (f * framework. Framework ) {
1003
1004
ginkgo .By ("Add daemonset which installs nvidia drivers" )
1004
- // the link differs from one in GKE documentation; discussed with @mindprince this one should be used
1005
- framework .RunKubectlOrDie (namespace , "apply" , "-f" , "https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/daemonset.yaml" )
1005
+
1006
+ dsYamlURL := "https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/daemonset.yaml"
1007
+ framework .Logf ("Using %v" , dsYamlURL )
1008
+ // Creates the DaemonSet that installs Nvidia Drivers.
1009
+ ds , err := e2emanifest .DaemonSetFromURL (dsYamlURL )
1010
+ framework .ExpectNoError (err )
1011
+ ds .Namespace = f .Namespace .Name
1012
+
1013
+ _ , err = f .ClientSet .AppsV1 ().DaemonSets (f .Namespace .Name ).Create (context .TODO (), ds , metav1.CreateOptions {})
1014
+ framework .ExpectNoError (err , "failed to create nvidia-driver-installer daemonset" )
1006
1015
}
1007
1016
1008
1017
func execCmd (args ... string ) * exec.Cmd {
0 commit comments