-
Notifications
You must be signed in to change notification settings - Fork 75
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
✨ Agent leader election config #349
✨ Agent leader election config #349
Conversation
Signed-off-by: Qing Hao <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: haoqing0110 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -163,6 +163,10 @@ type RegistrationConfiguration struct { | |||
// +kubebuilder:default:=100 | |||
KubeAPIBurst int32 `json:"kubeAPIBurst,omitempty"` | |||
|
|||
// Leader election configuration | |||
// +optional | |||
LeaderElectionConfig `json:",inline"` |
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.
I do not think it needs to be inline.
@@ -278,6 +286,42 @@ type WorkAgentConfiguration struct { | |||
AppliedManifestWorkEvictionGracePeriod *metav1.Duration `json:"appliedManifestWorkEvictionGracePeriod,omitempty"` | |||
} | |||
|
|||
// Leader election configuration | |||
type LeaderElectionConfig struct { | |||
// Disable leader election. |
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.
do we really need to expose every configurations here?
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.
Since the leader election will always be enabled in OCM single node case, and we are not 100% sure if it will impact the user's cases, it might be useful to provide a disable option in Klusterlet
.
Close this as open-cluster-management-io/ocm#727 will release the leadership when agent restarts and reduce the leader election time. |
Summary
Previously submitted PR open-cluster-management-io/ocm#695 to enable leader election of klusterlet-agent on single node managed cluster. It breaks some user e2e testing cases as they are using SNO for testing open-cluster-management-io/ocm#708, enabling the SNO leader election might cause the agent to wait as bad as 137s to start working.
Create this PR to make the agent leader election time configurable by
klusterletconfig
, so that user can reduce the time in testing.Related issue(s)
open-cluster-management-io/ocm#695
open-cluster-management-io/ocm#708