Skip to content
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

Conversation

haoqing0110
Copy link
Member

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

@openshift-ci openshift-ci bot requested review from mdelder and qiujian16 November 26, 2024 07:56
Copy link
Contributor

openshift-ci bot commented Nov 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: haoqing0110
Once this PR has been reviewed and has the lgtm label, please assign qiujian16 for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@haoqing0110 haoqing0110 changed the title Agent leader election config ✨ Agent leader election config Nov 26, 2024
@@ -163,6 +163,10 @@ type RegistrationConfiguration struct {
// +kubebuilder:default:=100
KubeAPIBurst int32 `json:"kubeAPIBurst,omitempty"`

// Leader election configuration
// +optional
LeaderElectionConfig `json:",inline"`
Copy link
Member

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.
Copy link
Member

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?

Copy link
Member Author

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.

@haoqing0110
Copy link
Member Author

Close this as open-cluster-management-io/ocm#727 will release the leadership when agent restarts and reduce the leader election time.

@haoqing0110 haoqing0110 deleted the br_klusterlet-config branch November 29, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants