-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(kuma-cp) user specified load balancer type per route #1402
Conversation
e4420d9
to
bd92491
Compare
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
bd92491
to
fb151fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nits, looks great!
switch lbConfig.HashFunction { | ||
case "XX_HASH", "MURMUR_HASH_2": | ||
default: | ||
root := validators.RootedAt("conf.loadBalancer.ringHash") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conf.loadBalancer.ringHash.hashFunction
var _ ClusterConfigurer = &LbConfigurer{} | ||
|
||
func (e *LbConfigurer) Configure(c *envoy_api.Cluster) error { | ||
// default ot Round Robin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ot
-> to
}), | ||
Entry("least request", testCase{ | ||
clusterName: "backend", | ||
lb: &v1alpha1.TrafficRoute_LoadBalancer{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: alias v1alpha1
to mesh_proto
(and it's |
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
I think it might be confusing that I'd suggest renaming this top level type: TrafficRoute
name: route-all-default
mesh: default
sources:
- match:
kuma.io/service: '*'
destinations:
- match:
kuma.io/service: '*'
conf:
defaultLoadBalancer:
roundRobin: {}
split:
- destination:
kuma.io/service: backend
version: 1
weight: 90
loadBalancer:
maglev: {}
- destination:
kuma.io/service: backend
version: 2
weight: 5
loadBalancer:
random: {}
- destination:
kuma.io/service: backend
version: 3
weight: 5 What do you think about it? |
@lobkovilya |
Sorry, I was confused by this line: subset.Lb = route.Spec.GetConf().GetLoadBalancer() nevermind |
@Mergifyio update |
Command
|
|
* feat(*) adding loadbalancer type to TrafficRoute Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com> (cherry picked from commit 8cffbaa)
* feat(*) adding loadbalancer type to TrafficRoute Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Summary
Extending the TrafficRoute to be able to specify the LoadBalancer type, reflecting Envoy's capabilities.
Supported types:
A sample Universal resource would look like this:
Where the
loadBalancer
field can have the following valuesIssues resolved
Fix #1030
Documentation