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

API for LoadBalancing Strategy in EnvoyProxy API #1477

Closed
wants to merge 1 commit into from

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Jun 3, 2023

  • Allows the user to configure a global load balancing strategy for the envoy proxy data plane
apiVersion: config.gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: set-lb-strategy
spec:
  traffic:
    loadBalancer:
      strategy: LeastRequest

* Allows the user to configure a global load balancing strategy
for the envoy proxy data plane

```
apiVersion: config.gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: set-lb-strategy
spec:
  traffic:
    loadBalancer:
      strategy: LeastRequest
```
* Sets the default load balancing strategy to `LeastRequest` which
will internally set the `WeightedLeastReqquest` knob in Envoy

* Relates to envoyproxy#1256 allowing
the user to fall back to `ClusterIP` style loadbalancing

* Relates to envoyproxy#1105

Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg arkodg requested a review from a team as a code owner June 3, 2023 00:22
@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Merging #1477 (2371a28) into main (572c495) will decrease coverage by 0.32%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1477      +/-   ##
==========================================
- Coverage   61.77%   61.46%   -0.32%     
==========================================
  Files          79       79              
  Lines       11490    11518      +28     
==========================================
- Hits         7098     7079      -19     
- Misses       3935     3979      +44     
- Partials      457      460       +3     
Impacted Files Coverage Δ
api/config/v1alpha1/envoyproxy_types.go 100.00% <ø> (ø)
api/config/v1alpha1/zz_generated.deepcopy.go 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

@zirain
Copy link
Member

zirain commented Jun 3, 2023

does gateway API support config this per route/backend?

// LoadBalancerStrategyClusterIP defines the "ClusterIP" load balancing strategy.
// In this mode, EnvoyProxy routes requests to the ClusterIP of the service and
// relies on another entity such as kube-proxy to perform load balancing to the upstream hosts.
LoadBalancerStrategyClusterIP LoadBalancerStrategy = "ClusterIP"
Copy link
Member

Choose a reason for hiding this comment

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

does this mean, eds will just send ClusterIP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is what is happening as of v0.4.0

Copy link
Member

Choose a reason for hiding this comment

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

correct me if I'm wrong, only ClusterIP will change the result of EDS, other types only change LbPolicy on envoy cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah thats right :)

Copy link
Member

Choose a reason for hiding this comment

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

this's a little odd to me, Is there any way to make them more consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you share why its odd, this API is meant for end users (platform owners / app owners) to configure LB policy, so they can

  • Use LB Policies provided at a L7 request level by Envoy (round-robin, least request, etc) or
  • LB Policies provided at a L3/L4 flow level by another intermediate data plane entity such as kube-proxy

@arkodg
Copy link
Contributor Author

arkodg commented Jun 3, 2023

does gateway API support config this per route/backend?

no, another way to expose this is to create a hierarchical policy called TrafficPolicy that can be applied to Gateway and to HTTPRoute, I think either should work

@arkodg
Copy link
Contributor Author

arkodg commented Jun 5, 2023

closing in favor of #1492

@arkodg arkodg closed this Jun 5, 2023
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