diff --git a/cmd/main.go b/cmd/main.go index 84812cd..6406d76 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -21,11 +21,13 @@ import ( "flag" "os" "path/filepath" + "time" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. _ "k8s.io/client-go/plugin/pkg/client/auth" + "k8s.io/utils/pointer" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" @@ -187,6 +189,10 @@ func main() { HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "f05533b6.engen.priv.no", + LeaseDuration: pointer.Duration(30 * time.Second), + RenewDeadline: pointer.Duration(20 * time.Second), + RetryPeriod: pointer.Duration(5 * time.Second), + // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly