-
Notifications
You must be signed in to change notification settings - Fork 331
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
Enable leader election by default. #1476
Enable leader election by default. #1476
Conversation
This consolidates the core of sharedmain around the new leaderelection logic, which will now be **enabled by default**. This can now be disabled with `--disable-ha` or by passing `sharedmain.WithHADisabled(ctx)` to `sharedmain.MainWithConfig`.
/hold While I stage things |
Downstream serving PR: knative/serving#8602 |
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.
/lgmt
/hold
if you want to upgrade to issue number.
controllers, _ := ControllersAndWebhooksFromCtors(ctx, cmw, ctors...) | ||
WatchLoggingConfigOrDie(ctx, cmw, logger, atomicLevel, component) | ||
WatchObservabilityConfigOrDie(ctx, cmw, profilingHandler, logger, component) | ||
// TODO(mattmoor): Remove this once HA is stable. |
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.
issue rather?
/lgtm |
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.
/lgtm
I guess the title should be Enable leader election by default
?
func WebhookMainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor) { | ||
// MainWithConfig runs the generic main flow for controllers and webhooks | ||
// with the given config. | ||
func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor) { |
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.
If leader election mode is enabled, before this change:
- webhook is running on bucket level leader election mode.
- other controllers are running on pod level leader election mode.
After this change, all controllers are running on bucket level leader election mode. Is my understading right?
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.
yes
This race was uncovered by the chaos duck on knative/serving! When we have enabled a feature flag, e.g. multi-container, and the webhook pods are restarted, there is a brief window where the webhook is up and healthy before the configmaps have synchronized and the new webhook pod realizes the feature is enabled.
I pushed one additional change that was uncovered by the chaos testing downstream on serving. With this, I've had at least one clean run of serving (rerunning now) and just pushed it to the eventing PR. |
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.
/lgtm
/lgtm /hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor, vaikas The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The following is the coverage report on the affected files.
|
/lgtm |
/hold cancel I am going to land this now, and after lunch I'll start rebasing and landing the downstream PRs. |
This consolidates the core of sharedmain around the new leaderelection logic, which will now be enabled by default.
This can now be disabled with
--disable-ha
or by passingsharedmain.WithHADisabled(ctx)
tosharedmain.MainWithConfig
./assign @pmorie @vagababov @markusthoemmes