-
Notifications
You must be signed in to change notification settings - Fork 393
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
HTTPRoute weighted backends with filters attached sends traffic to the wrong backend #5230
Comments
The issue here is that the route configuration after being weighted goes to the same cluster "route": {
"weighted_clusters": {
"clusters": [
{
"name": "httproute/default/sample/rule/0",
"weight": 10,
"request_headers_to_add": [
{
"header": {
"key": "first",
"value": "first"
},
"append_action": "OVERWRITE_IF_EXISTS_OR_ADD"
}
]
},
{
"name": "httproute/default/sample/rule/0",
"weight": 10,
"request_headers_to_add": [
{
"header": {
"key": "second",
"value": "second"
},
"append_action": "OVERWRITE_IF_EXISTS_OR_ADD"
}
]
}
]
},
"cluster_not_found_response_code": "INTERNAL_SERVER_ERROR",
"upgrade_configs": [
{
"upgrade_type": "websocket"
}
]
}, Then the ClusterLoadAssignment does another weighted selection across endpoints. "endpoint_config": {
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
"cluster_name": "httproute/default/sample/rule/0",
"endpoints": [
{
"locality": {
"region": "httproute/default/sample/rule/0/backend/0"
},
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "10.244.0.22",
"port_value": 8080
}
},
"health_check_config": {}
},
"health_status": "HEALTHY",
"load_balancing_weight": 1
}
],
"load_balancing_weight": 10
},
{
"locality": {
"region": "httproute/default/sample/rule/0/backend/1"
},
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "10.244.0.21",
"port_value": 8080
}
},
"health_check_config": {}
},
"health_status": "HEALTHY",
"load_balancing_weight": 1
}
],
"load_balancing_weight": 10
}
],
"policy": {
"overprovisioning_factor": 140
}
} |
I think the right thing to do is to setup each Kubernetes Service as it's own 'cluster' and not a |
thanks for flagging this @dprotaso, looks like traffic splitting doesnt work correctly when backendRefs.filters is set because internally we use weighted clusters for this case there are 2 issues
|
this is the relevant code that needs to be updated gateway/internal/xds/translator/route.go Line 238 in bc190aa
|
Upstream k8s conformance test that exercises this issue - kubernetes-sigs/gateway-api#3604 |
Description:
When I add an weighted backend to an HTTPRoute I expect traffic to go to that backend with the correct filters applied
Instead I'm seeing traffic being sent to the wrong backend.
Repro steps:
Go HTTP Sever
Next deploy two workloads using this go application
Next we configure two routes with equal weights. For each backend we add request headers to correctly identify the split that should occur.
After making requests to
sample.com
- you'll see the wrong headers end up in the wrong backendSee:
First: first
in the below logsEnvironment:
Using Envoy Gateway v1.3.0 testing on kind using
cloud-provider-kind
Logs:
The text was updated successfully, but these errors were encountered: