Slow the default lease retry and renew rate for MHC controller
Prevent machine controllers from writing in etcd at idle too often
by setting 30s retry and 90s deadline on all renewals.
BZ
@@ -20,6 +20,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)
+// The default durations for the leader electrion operations.
+var (
+ retryPeriod = 30 * time.Second
+ renewDealine = 90 * time.Second
+)
+
func printVersion() {
glog.Infof("Go Version: %s", runtime.Version())
glog.Infof("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH)
@@ -79,6 +85,9 @@ func main() {
LeaderElectionNamespace: *leaderElectResourceNamespace,
LeaderElectionID: "cluster-api-provider-healthcheck-leader",
LeaseDuration: leaderElectLeaseDuration,
+ // Slow the default retry and renew election rate to reduce etcd writes at idle: BZ 1858400
+ RetryPeriod: &retryPeriod,
+ RenewDeadline: &renewDealine,
}
if *watchNamespace != "" {
