-
Notifications
You must be signed in to change notification settings - Fork 301
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
Configure leader election with completely separate k8s client #623
Configure leader election with completely separate k8s client #623
Conversation
186c613
to
0757360
Compare
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.
One comment - other than that LGTM.
[In a separate PR, we should probably create a separate client for events too]
cmd/glbc/main.go
Outdated
@@ -83,6 +83,12 @@ func main() { | |||
glog.Fatalf("Failed to create kubernetes client: %v", err) | |||
} | |||
|
|||
// Due to scaling issues, the leader election must be configured with a separate k8s client. | |||
leaderElectKubeClient, err := kubernetes.NewForConfig(kubeConfig) |
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.
Can you please add a user agent to facilitate future debugging as done .e.g here:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-scheduler/app/options/options.go#L326
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.
Done
0757360
to
b49beb8
Compare
@wojtek-t -- maybe the leader election code should create the client internally for the default use case? This seems like an easy thing to mess up. |
I'm not the one who created this library and I'm not really maintaining it. But sure - that makes a lot of sense to me. Making kubeconfig a parameter of constructor for leader election makes a lot of sense. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, rramkumar1 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 |
Cherrypick #623 on 1.4 branch
Due to some scaling issues, we need to configure leader election with a separate k8s client then what is used for other API server operations (watch, events, etc).
This puts ingress-gce in line w/ how scheduler and controller-manager implement leader election.