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

Introduce load balancer for client-go #4756

Closed
4 tasks
chenk008 opened this issue Jul 10, 2024 · 5 comments
Closed
4 tasks

Introduce load balancer for client-go #4756

chenk008 opened this issue Jul 10, 2024 · 5 comments
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@chenk008
Copy link
Contributor

chenk008 commented Jul 10, 2024

Enhancement Description

  • One-line enhancement description (can be used as a release note): Introduce load balancer for client-go
  • Kubernetes Enhancement Proposal:

Background:

  1. client-go use http2/gRPC to call APIServer. For GRPC and HTTP2, the client will only try to establish 1 single tcp connection.
  2. High Availability Kubernetes clusters can be achieved by putting the API Server instances behind a load balancer. It is usually an L4 proxy.
  3. Connection-level balancing isn't very useful. Once the connection is established, there's no more balancing to be done. All requests will get pinned to a single APIServer.

Proposal:

  1. Add feature-gate 'CLIENT_LOAD_BALANCE', it will introduce load balancer which is similar to gRPC round_robin load balancer
  2. We set multiple endpoint in client. The load balancer will connects to all the addresses it sees, and sends an request to each backend one at a time in order
  3. Optional: client-go could get service kubernetes endpoints, and add all endpoints to load balancer.
  4. Optional: Add a new headless service kubernetes-headless, client-go could get all endpoints from dns server.
  • Discussion Link:
  • Primary contact (assignee): @chenk008
  • Responsible SIGs:
  • Enhancement target (which target equals to which milestone):
    • Alpha release target (x.y):
    • Beta release target (x.y):
    • Stable release target (x.y):
  • Alpha
    • KEP (k/enhancements) update PR(s):
    • Code (k/k) update PR(s):
    • Docs (k/website) update PR(s):

Please keep this description up to date. This will help the Enhancement Team to track the evolution of the enhancement efficiently.

@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 10, 2024
@k8s-ci-robot
Copy link
Contributor

@chenk008: The label(s) sig/sig-api-machinery cannot be applied, because the repository doesn't have them.

In response to this:

/sig sig-api-machinery

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chenk008
Copy link
Contributor Author

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 11, 2024
@aojea
Copy link
Member

aojea commented Jul 15, 2024

There is a long discussion about this problem here kubernetes/kubernetes#18174.

A client side loadbalancer KEP was proposed and the decision was to avoid it because it does not address completely all the existing problems and increase the client complexity, see @deads2k comment here #3034 (comment)

@chenk008
Copy link
Contributor Author

@aojea Thanks for your reminder.

May I ask, is it possible to only provide the capability of client load balancing, and leave the implementation of discovering multiple endpoints up to the developers?

case 1: An operator developer want to distribute the requests across multiple servers .
case 2: When a cloud vendor supports to expose multiple apiserver endpoints through DNS, the kubelet/kube-proxy could distribute the requests.

@chenk008 chenk008 reopened this Jul 15, 2024
@chenk008
Copy link
Contributor Author

Currently, we have not found an appropriate method to solve the dependency issues. I closes this issue for now.

I hope there's a way to address the problem of unbalanced request loads for multiples apiserver. @deads2k @aojea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

3 participants