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

Configure leader election with completely separate k8s client #623

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

rramkumar1
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 5, 2019
Copy link
Member

@wojtek-t wojtek-t left a 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)
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@bowei
Copy link
Member

bowei commented Feb 5, 2019

@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.

@wojtek-t
Copy link
Member

wojtek-t commented Feb 5, 2019

@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.

@bowei
Copy link
Member

bowei commented Feb 6, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2019
@k8s-ci-robot
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants