diff --git a/pkg/controller/daemon/daemoncontroller.go b/pkg/controller/daemon/daemoncontroller.go index 733e8d31262..e9d4e2f0736 100644 --- a/pkg/controller/daemon/daemoncontroller.go +++ b/pkg/controller/daemon/daemoncontroller.go @@ -346,7 +346,9 @@ func (dsc *DaemonSetsController) updatePod(old, cur interface{}) { dsc.enqueueDaemonSet(ds) // See https://github.com/kubernetes/kubernetes/pull/38076 for more details if changedToReady && ds.Spec.MinReadySeconds > 0 { - dsc.enqueueDaemonSetAfter(ds, time.Duration(ds.Spec.MinReadySeconds)*time.Second) + // Add a second to avoid milliseconds skew in AddAfter. + // See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info. + dsc.enqueueDaemonSetAfter(ds, (time.Duration(ds.Spec.MinReadySeconds)*time.Second)+time.Second) } return } diff --git a/pkg/controller/deployment/progress.go b/pkg/controller/deployment/progress.go index 9c02f2f669f..7d1f1b20971 100644 --- a/pkg/controller/deployment/progress.go +++ b/pkg/controller/deployment/progress.go @@ -233,6 +233,8 @@ func (dc *DeploymentController) requeueStuckDeployment(d *extensions.Deployment, return time.Duration(0) } glog.V(4).Infof("Queueing up deployment %q for a progress check after %ds", d.Name, int(after.Seconds())) - dc.enqueueAfter(d, after) + // Add a second to avoid milliseconds skew in AddAfter. + // See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info. + dc.enqueueAfter(d, after+time.Second) return after } diff --git a/pkg/controller/replicaset/replica_set.go b/pkg/controller/replicaset/replica_set.go index 0a31df9122f..256b3ad81ca 100644 --- a/pkg/controller/replicaset/replica_set.go +++ b/pkg/controller/replicaset/replica_set.go @@ -320,7 +320,9 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) { // "closer" to kubelet (from the deployment to the replica set controller). if !v1.IsPodReady(oldPod) && v1.IsPodReady(curPod) && rs.Spec.MinReadySeconds > 0 { glog.V(2).Infof("ReplicaSet %q will be enqueued after %ds for availability check", rs.Name, rs.Spec.MinReadySeconds) - rsc.enqueueReplicaSetAfter(rs, time.Duration(rs.Spec.MinReadySeconds)*time.Second) + // Add a second to avoid milliseconds skew in AddAfter. + // See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info. + rsc.enqueueReplicaSetAfter(rs, (time.Duration(rs.Spec.MinReadySeconds)*time.Second)+time.Second) } return } diff --git a/pkg/controller/replication/replication_controller.go b/pkg/controller/replication/replication_controller.go index 332cf1d85f2..6a78bbe2f03 100644 --- a/pkg/controller/replication/replication_controller.go +++ b/pkg/controller/replication/replication_controller.go @@ -319,7 +319,9 @@ func (rm *ReplicationManager) updatePod(old, cur interface{}) { // "closer" to kubelet (from the deployment to the ReplicationController controller). if !v1.IsPodReady(oldPod) && v1.IsPodReady(curPod) && rc.Spec.MinReadySeconds > 0 { glog.V(2).Infof("ReplicationController %q will be enqueued after %ds for availability check", rc.Name, rc.Spec.MinReadySeconds) - rm.enqueueControllerAfter(rc, time.Duration(rc.Spec.MinReadySeconds)*time.Second) + // Add a second to avoid milliseconds skew in AddAfter. + // See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info. + rm.enqueueControllerAfter(rc, (time.Duration(rc.Spec.MinReadySeconds)*time.Second)+time.Second) } return }