@@ -872,7 +872,7 @@ func (nc *Controller) processTaintBaseEviction(node *v1.Node, observedReadyCondi
872
872
if ! nodeutil .SwapNodeControllerTaint (nc .kubeClient , []* v1.Taint {& taintToAdd }, []* v1.Taint {UnreachableTaintTemplate }, node ) {
873
873
klog .Errorf ("Failed to instantly swap UnreachableTaint to NotReadyTaint. Will try again in the next cycle." )
874
874
}
875
- } else if nc .markNodeForTainting (node ) {
875
+ } else if nc .markNodeForTainting (node , v1 . ConditionFalse ) {
876
876
klog .V (2 ).Infof ("Node %v is NotReady as of %v. Adding it to the Taint queue." ,
877
877
node .Name ,
878
878
decisionTimestamp ,
@@ -885,7 +885,7 @@ func (nc *Controller) processTaintBaseEviction(node *v1.Node, observedReadyCondi
885
885
if ! nodeutil .SwapNodeControllerTaint (nc .kubeClient , []* v1.Taint {& taintToAdd }, []* v1.Taint {NotReadyTaintTemplate }, node ) {
886
886
klog .Errorf ("Failed to instantly swap NotReadyTaint to UnreachableTaint. Will try again in the next cycle." )
887
887
}
888
- } else if nc .markNodeForTainting (node ) {
888
+ } else if nc .markNodeForTainting (node , v1 . ConditionUnknown ) {
889
889
klog .V (2 ).Infof ("Node %v is unresponsive as of %v. Adding it to the Taint queue." ,
890
890
node .Name ,
891
891
decisionTimestamp ,
@@ -1476,9 +1476,21 @@ func (nc *Controller) evictPods(node *v1.Node, pods []*v1.Pod) (bool, error) {
1476
1476
return nc .zonePodEvictor [utilnode .GetZoneKey (node )].Add (node .Name , string (node .UID )), nil
1477
1477
}
1478
1478
1479
- func (nc * Controller ) markNodeForTainting (node * v1.Node ) bool {
1479
+ func (nc * Controller ) markNodeForTainting (node * v1.Node , status v1. ConditionStatus ) bool {
1480
1480
nc .evictorLock .Lock ()
1481
1481
defer nc .evictorLock .Unlock ()
1482
+ if status == v1 .ConditionFalse {
1483
+ if ! taintutils .TaintExists (node .Spec .Taints , NotReadyTaintTemplate ) {
1484
+ nc .zoneNoExecuteTainter [utilnode .GetZoneKey (node )].SetRemove (node .Name )
1485
+ }
1486
+ }
1487
+
1488
+ if status == v1 .ConditionUnknown {
1489
+ if ! taintutils .TaintExists (node .Spec .Taints , UnreachableTaintTemplate ) {
1490
+ nc .zoneNoExecuteTainter [utilnode .GetZoneKey (node )].SetRemove (node .Name )
1491
+ }
1492
+ }
1493
+
1482
1494
return nc .zoneNoExecuteTainter [utilnode .GetZoneKey (node )].Add (node .Name , string (node .UID ))
1483
1495
}
1484
1496
0 commit comments