File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import (
3939 _ "k8s.io/client-go/plugin/pkg/client/auth"
4040 "k8s.io/klog/v2"
4141 "k8s.io/klog/v2/textlogger"
42+ "k8s.io/utils/ptr"
4243 ctrl "sigs.k8s.io/controller-runtime"
4344 crcache "sigs.k8s.io/controller-runtime/pkg/cache"
4445 "sigs.k8s.io/controller-runtime/pkg/client"
@@ -167,7 +168,13 @@ func main() {
167168 HealthProbeBindAddress : probeAddr ,
168169 LeaderElection : enableLeaderElection ,
169170 LeaderElectionID : "9c4404e7.operatorframework.io" ,
170- Cache : cacheOptions ,
171+ // Recommended Leader Election values
172+ // https://github.com/openshift/enhancements/blob/61581dcd985130357d6e4b0e72b87ee35394bf6e/CONVENTIONS.md#handling-kube-apiserver-disruption
173+ LeaseDuration : ptr .To (137 * time .Second ),
174+ RenewDeadline : ptr .To (107 * time .Second ),
175+ RetryPeriod : ptr .To (26 * time .Second ),
176+
177+ Cache : cacheOptions ,
171178 // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
172179 // when the Manager ends. This requires the binary to immediately end when the
173180 // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
You can’t perform that action at this time.
0 commit comments