envoyproxy / envoyproxy/gateway
Support Ring Hash Load Balancing Policy in BackendTrafficPolicy
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
*Description*:
> Currently, when configuring consistent hashing via BackendTrafficPolicy, Envoy Gateway defaults the underlying Envoy load balancing policy to Maglev. While Maglev is efficient for large lookups, it lacks some of the configuration flexibility and specific stability characteristics provided by Ring Hash, which is natively supported by the Envoy proxy.
To achieve Ring Hash today, users must resort to EnvoyPatchPolicy (xDS patching), which is complex to maintain and requires manual cluster name targeting. It would be beneficial to have RingHash as a first-class option within the BackendTrafficPolicy API.
Current Behavior
Setting loadBalancer.type: ConsistentHash in a BackendTrafficPolicy automatically generates an Envoy Cluster with lb_policy: MAGLEV. There is no field to specify an alternative consistent hashing algorithm.
Proposed Enhancement
Extend the BackendTrafficPolicy (or the loadBalancer configuration) to allow users to specify the consistent hashing algorithm and its associated parameters.
Example:
```
spec:
loadBalancer:
type: ConsistentHash
consistentHash:
type: Header
header:
name: x-user-id
lbPolicy: RingHash
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.