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

proposal: Locality Load Balancing for Kmesh #418

Open
derekwin opened this issue Jun 5, 2024 · 3 comments
Open

proposal: Locality Load Balancing for Kmesh #418

derekwin opened this issue Jun 5, 2024 · 3 comments

Comments

@derekwin
Copy link

derekwin commented Jun 5, 2024

Why:

Currently, kmesh does not support locality topology-aware load balancing. The purpose of this proposal is to add locality-based topology-aware load balancing capabilities to kmesh, corresponding to locality load balancing in Istio.

Plan:

  1. Add new enum fields for the load balancing methods and implement the corresponding load balancing functions in cluster.h to support locality failover and locality weighted distribution. Refer to the implementation in the Istio control plane : https://github1s.com/istio/istio/blob/master/pilot/pkg/networking/core/loadbalancer/loadbalancer.go
  2. Implement the corresponding data structures combining parameters such as BalancingWeight, Priority, and Locality (new data structures may not be needed). Ensure that the load balancing functions have the capability to retrieve these parameters. The existing parameters are stored in the cluster's cache through the proto interface (in Go).

more detials:
https://zrsnlqw1xd.feishu.cn/docx/Qpr6dtfe8olpBcx5HNscLotdn8c?from=from_copylink

@hzxuzhonghu
Copy link
Member

Assume you mean the ads mode, right? And this is also missing in workload mode.

@kwb0523
Copy link
Contributor

kwb0523 commented Jun 6, 2024

@derekwin We need to prioritize implementation in the workload mode.

@derekwin
Copy link
Author

derekwin commented Jun 6, 2024

Make adjustments to the proposal: focus on the implementation of locality load balancing under the workload model.

  1. The workload model requires implementing the corresponding load balancing logic in bpf\kmesh\workload\include\service.h, new load banlance handler function is similar to lb_random_handle.(locality failover, locality weighted distribution, ref
  2. Retrieve the load_balancing_weight and priority configurations from api/endpoint/endpoint.proto interface, and obtain the Locality configuration from api/workloadapi/workload.proto.
  3. Add the Locality load balance configuration field to pkg\controller\config.go.
  4. Add a new load balance type to api/cluster/cluster.proto.

more details: document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants