Skip to content

Commit

Permalink
[#700] Expose timeout options for leader election
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev committed Oct 6, 2023
1 parent deab671 commit 9739447
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func main() {
"Enabling this will ensure there is only one active controller manager.")
flag.Int64Var(&leaseDurationSeconds, "lease-duration", 15, "LeaseDuration is the duration that non-leader candidates will wait to force acquire leadership. This is measured against time of last observed ack. Default is 15 seconds.")
flag.Int64Var(&renewDeadlineSeconds, "renew-deadline", 10, "RenewDeadline is the duration that the acting controlplane will retry refreshing leadership before giving up. Default is 10 seconds.")
flag.Int64Var(&retryPeriodSeconds, "retry-period", 10, "RenewDeadline is the duration that the acting controlplane will retry refreshing leadership before giving up. Default is 10 seconds.")
flag.Int64Var(&retryPeriodSeconds, "retry-period", 2, "RetryPeriod is the duration the LeaderElector clients should wait between tries of actions. Default is 2 seconds.")
opts := zap.Options{
Development: true,
}
Expand Down Expand Up @@ -186,6 +186,17 @@ func main() {
}
}

setupLog.Info("Manager options",
"Namespace", mgrOptions.Namespace,
"MetricsBindAddress", mgrOptions.MetricsBindAddress,
"Port", mgrOptions.Port,
"HealthProbeBindAddress", mgrOptions.HealthProbeBindAddress,
"LeaderElection", mgrOptions.LeaderElection,
"LeaderElectionID", mgrOptions.LeaderElectionID,
"LeaseDuration", mgrOptions.LeaseDuration,
"RenewDeadline", mgrOptions.RenewDeadline,
"RetryPeriod", mgrOptions.RetryPeriod)

mgr, err := ctrl.NewManager(cfg, mgrOptions)
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 9739447

Please sign in to comment.