@@ -19,6 +19,7 @@ package main
1919import (
2020 "flag"
2121 "os"
22+ "time"
2223
2324 // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2425 // to ensure that exec-entrypoint and run can make use of them.
@@ -65,13 +66,21 @@ func main() {
6566
6667 ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
6768
69+ // we extend these because the API server is often unavailable during reconciliation for this operator
70+ leaseDuration := 60 * time .Second
71+ renewDeadline := 50 * time .Second
72+ retryPeriod := 10 * time .Second
73+
6874 mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
6975 Scheme : scheme ,
7076 MetricsBindAddress : metricsAddr ,
7177 Port : 9443 ,
7278 HealthProbeBindAddress : probeAddr ,
7379 LeaderElection : enableLeaderElection ,
7480 LeaderElectionID : "f4de3632.rhsyseng.github.io" ,
81+ LeaseDuration : & leaseDuration ,
82+ RenewDeadline : & renewDeadline ,
83+ RetryPeriod : & retryPeriod ,
7584 // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
7685 // when the Manager ends. This requires the binary to immediately end when the
7786 // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
0 commit comments