You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BackendTrafficPolicy ConsistentHash (SourceIP) not working for UDPRoute #9534
When we change the load balancing policy in BackendTrafficPolicy to consistent hashing based on source IP (ConsistentHash + SourceIP), we notice that if it targets a UDPRoute, the traffic is not routed consistently by the source IP; instead, it still feels like it is being distributed randomly.
I wanted to check if this is a known limitation of the current Gateway API or our specific controller regarding the UDP protocol. Has anyone else run into a similar issue with UDP session persistence failing?
After applying this patch, the UDP traffic started being routed consistently based on the client's source IP.
However, I am not completely sure if this is the recommended or standard way to handle this, or if BackendTrafficPolicy should automatically generate this Envoy configuration when applied to a UDPRoute. Could anyone confirm if this approach is correct or if there are any edge cases I should be aware of?
Hi @arkodg, I'd be happy to take this up if no one is already working on it.
From the investigation and the workaround shared above, it seems BackendTrafficPolicy is correctly configuring consistent hashing for HTTP/TCP, but the equivalent Envoy configuration isn't being propagated for UDPRoute. I'll dig into how the translation for UDP listeners is generated and work on making BackendTrafficPolicy automatically configure source-IP consistent hashing for UDP instead of requiring an EnvoyPatchPolicy.
Activity
hhllxx1121 commentedon Jul 21, 2026
I gave this a try using an
EnvoyPatchPolicyto injecthash_policiesdirectly into the UDP Listener filter:After applying this patch, the UDP traffic started being routed consistently based on the client's source IP.
However, I am not completely sure if this is the recommended or standard way to handle this, or if BackendTrafficPolicy should automatically generate this Envoy configuration when applied to a UDPRoute. Could anyone confirm if this approach is correct or if there are any edge cases I should be aware of?
arkodg commentedon Jul 27, 2026
looks like a bug, thanks for sharing the workaround until its fixed
Aditya7880900936 commentedon Jul 27, 2026
Hi @arkodg, I'd be happy to take this up if no one is already working on it.
From the investigation and the workaround shared above, it seems
BackendTrafficPolicyis correctly configuring consistent hashing for HTTP/TCP, but the equivalent Envoy configuration isn't being propagated forUDPRoute. I'll dig into how the translation for UDP listeners is generated and work on makingBackendTrafficPolicyautomatically configure source-IP consistent hashing for UDP instead of requiring anEnvoyPatchPolicy.Could you please assign this issue to me? Thanks!