@@ -34,8 +34,8 @@ import (
3434)
3535
3636const (
37- // renewInterval is the interval at which the lease is renewed
38- renewInterval = 10 * time .Second
37+ // defaultRenewInterval is the default interval at which the lease is renewed
38+ defaultRenewInterval = 10 * time .Second
3939 // maxUpdateRetries is the number of immediate, successive retries the Kubelet will attempt
4040 // when renewing the lease before it waits for the renewal interval before trying again,
4141 // similar to what we do for node status retries
@@ -60,11 +60,21 @@ type controller struct {
6060}
6161
6262// NewController constructs and returns a controller
63- func NewController (clock clock.Clock , client clientset.Interface , holderIdentity string , leaseDurationSeconds int32 , onRepeatedHeartbeatFailure func ()) Controller {
63+ func NewController (clock clock.Clock , client clientset.Interface , holderIdentity string , leaseDurationSeconds int32 , nodeStatusUpdateFrequency time. Duration , onRepeatedHeartbeatFailure func ()) Controller {
6464 var leaseClient coordclientset.LeaseInterface
6565 if client != nil {
6666 leaseClient = client .CoordinationV1 ().Leases (corev1 .NamespaceNodeLease )
6767 }
68+ renewInterval := defaultRenewInterval
69+ // Users are able to decrease the timeout after which nodes are being
70+ // marked as "Ready: Unknown" by NodeLifecycleController to values
71+ // smaller than defaultRenewInterval. Until the knob to configure
72+ // lease renew interval is exposed to user, we temporarily decrease
73+ // renewInterval based on the NodeStatusUpdateFrequency.
74+ if renewInterval > nodeStatusUpdateFrequency {
75+ renewInterval = nodeStatusUpdateFrequency
76+ }
77+
6878 return & controller {
6979 client : client ,
7080 leaseClient : leaseClient ,
0 commit comments