diff --git a/pkg/controller/statefulset/stateful_set_control.go b/pkg/controller/statefulset/stateful_set_control.go index 9a76409ce3..c46a531b0b 100644 --- a/pkg/controller/statefulset/stateful_set_control.go +++ b/pkg/controller/statefulset/stateful_set_control.go @@ -581,12 +581,15 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( continue } // if we are in monotonic mode and the condemned target is not the first unhealthy Pod block - if !isRunningAndReady(condemned[target]) && monotonic && condemned[target] != firstUnhealthyPod { + if avail, waitTime := isRunningAndAvailable(condemned[target], minReadySeconds); !avail && monotonic && condemned[target] != firstUnhealthyPod { klog.V(4).Infof( - "StatefulSet %s/%s is waiting for Pod %s to be Running and Ready prior to scale down", + "StatefulSet %s/%s is waiting for Pod %s to be Running and Available prior to scale down", set.Namespace, set.Name, firstUnhealthyPod.Name) + if waitTime > 0 { + durationStore.Push(getStatefulSetKey(condemned[target]), waitTime) + } return &status, nil } klog.V(2).Infof("StatefulSet %s/%s terminating Pod %s for scale down",