-
Notifications
You must be signed in to change notification settings - Fork 66
🐛 Set recommended leaderelection settings #1663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ import ( | |
_ "k8s.io/client-go/plugin/pkg/client/auth" | ||
"k8s.io/klog/v2" | ||
"k8s.io/klog/v2/textlogger" | ||
"k8s.io/utils/ptr" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
crcache "sigs.k8s.io/controller-runtime/pkg/cache" | ||
"sigs.k8s.io/controller-runtime/pkg/certwatcher" | ||
|
@@ -229,7 +230,13 @@ func main() { | |
HealthProbeBindAddress: probeAddr, | ||
LeaderElection: enableLeaderElection, | ||
LeaderElectionID: "9c4404e7.operatorframework.io", | ||
Cache: cacheOptions, | ||
// Recommended Leader Election values | ||
// https://github.com/openshift/enhancements/blob/61581dcd985130357d6e4b0e72b87ee35394bf6e/CONVENTIONS.md#handling-kube-apiserver-disruption | ||
LeaseDuration: ptr.To(137 * time.Second), | ||
RenewDeadline: ptr.To(107 * time.Second), | ||
RetryPeriod: ptr.To(26 * time.Second), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎉 I think we need to do the same for catalogd : https://github.com/operator-framework/operator-controller/blob/main/catalogd/cmd/catalogd/main.go There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done :) |
||
|
||
Cache: cacheOptions, | ||
// 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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to try and avoid pulling in a new dependency just for a small helper that returns a pointer to value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a new dependency:
operator-controller/go.mod
Line 38 in f055efc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that 5000k lines vendor tricked me :)