@@ -1375,6 +1375,24 @@ func podSpec(
1375
1375
return nil , fmt .Errorf ("marshal VM Status: %w" , err )
1376
1376
}
1377
1377
1378
+ // We have to add tolerations explicitly here.
1379
+ // Otherwise, if the k8s node becomes unavailable, the default
1380
+ // tolerations will be added, which are 300s (5m) long, which is
1381
+ // not acceptable for us.
1382
+ tolerations := append ([]corev1.Toleration {}, vm .Spec .Tolerations ... )
1383
+ tolerations = append (tolerations ,
1384
+ corev1.Toleration {
1385
+ Key : "node.kubernetes.io/not-ready" ,
1386
+ TolerationSeconds : lo .ToPtr (int64 (30 )),
1387
+ Effect : "NoExecute" ,
1388
+ },
1389
+ corev1.Toleration {
1390
+ Key : "node.kubernetes.io/unreachable" ,
1391
+ TolerationSeconds : lo .ToPtr (int64 (30 )),
1392
+ Effect : "NoExecute" ,
1393
+ },
1394
+ )
1395
+
1378
1396
pod := & corev1.Pod {
1379
1397
ObjectMeta : metav1.ObjectMeta {
1380
1398
Name : vm .Status .PodName ,
@@ -1389,7 +1407,7 @@ func podSpec(
1389
1407
TerminationGracePeriodSeconds : vm .Spec .TerminationGracePeriodSeconds ,
1390
1408
NodeSelector : vm .Spec .NodeSelector ,
1391
1409
ImagePullSecrets : vm .Spec .ImagePullSecrets ,
1392
- Tolerations : vm . Spec . Tolerations ,
1410
+ Tolerations : tolerations ,
1393
1411
ServiceAccountName : vm .Spec .ServiceAccountName ,
1394
1412
SchedulerName : vm .Spec .SchedulerName ,
1395
1413
Affinity : affinity ,
0 commit comments