@@ -38,8 +38,8 @@ type Kubeclient struct {
38
38
}
39
39
40
40
const (
41
- hostNetworkDebugAppLabel = "debug-mariner"
42
- podNetworkDebugAppLabel = "debugnonhost-mariner"
41
+ hostNetworkDebugAppLabel = "debug-mariner-tolerated "
42
+ podNetworkDebugAppLabel = "debugnonhost-mariner-tolerated "
43
43
)
44
44
45
45
func getClusterKubeClient (ctx context.Context , resourceGroupName , clusterName string ) (* Kubeclient , error ) {
@@ -164,10 +164,6 @@ func (k *Kubeclient) WaitUntilNodeReady(ctx context.Context, t *testing.T, vmssN
164
164
node = castNode
165
165
nodeTaints , _ := json .Marshal (node .Spec .Taints )
166
166
nodeConditions , _ := json .Marshal (node .Status .Conditions )
167
- if len (node .Spec .Taints ) > 0 {
168
- t .Logf ("node %s is tainted. Taints: %s Conditions: %s" , node .Name , string (nodeTaints ), string (nodeConditions ))
169
- continue
170
- }
171
167
172
168
for _ , cond := range node .Status .Conditions {
173
169
if cond .Type == corev1 .NodeReady && cond .Status == corev1 .ConditionTrue {
@@ -417,6 +413,23 @@ func daemonsetDebug(t *testing.T, deploymentName, targetNodeLabel, privateACRNam
417
413
},
418
414
},
419
415
},
416
+ // Set Tolerations to tolerate the node with test taints "testkey1=value1:NoSchedule,testkey2=value2:NoSchedule".
417
+ // This is to ensure that the pod can be scheduled on the node with the taints.
418
+ // It won't affect other pods running on the same node.
419
+ Tolerations : []corev1.Toleration {
420
+ {
421
+ Key : "testkey1" ,
422
+ Operator : corev1 .TolerationOpEqual ,
423
+ Value : "value1" ,
424
+ Effect : corev1 .TaintEffectNoSchedule ,
425
+ },
426
+ {
427
+ Key : "testkey2" ,
428
+ Operator : corev1 .TolerationOpEqual ,
429
+ Value : "value2" ,
430
+ Effect : corev1 .TaintEffectNoSchedule ,
431
+ },
432
+ },
420
433
},
421
434
},
422
435
},
@@ -468,6 +481,23 @@ func podHTTPServerLinux(s *Scenario) *corev1.Pod {
468
481
},
469
482
},
470
483
},
484
+ // Set Tolerations to tolerate the node with test taints "testkey1=value1:NoSchedule,testkey2=value2:NoSchedule".
485
+ // This is to ensure that the pod can be scheduled on the node with the taints.
486
+ // It won't affect other pods running on the same node.
487
+ Tolerations : []corev1.Toleration {
488
+ {
489
+ Key : "testkey1" ,
490
+ Operator : corev1 .TolerationOpEqual ,
491
+ Value : "value1" ,
492
+ Effect : corev1 .TaintEffectNoSchedule ,
493
+ },
494
+ {
495
+ Key : "testkey2" ,
496
+ Operator : corev1 .TolerationOpEqual ,
497
+ Value : "value2" ,
498
+ Effect : corev1 .TaintEffectNoSchedule ,
499
+ },
500
+ },
471
501
NodeSelector : map [string ]string {
472
502
"kubernetes.io/hostname" : s .Runtime .KubeNodeName ,
473
503
},
0 commit comments