envoyproxy/gateway

BackendTrafficPolicy ConsistentHash (SourceIP) not working for UDPRoute

开放

#9,534 创建于 2026年7月20日

 (3 条评论) (0 个反应) (0 位负责人)Go (802 个派生)auto 404
help wantedkind/bug

仓库指标

星标
 (2,871 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description:

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?

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  creationTimestamp: "2026-07-20T14:37:19Z"
  generation: 3
  name: udp-policy
  namespace: test
  resourceVersion: "73853849"
  uid: 3005640b-8be2-4204-b128-a1ea74c38ade
spec:
  loadBalancer:
    consistentHash:
      tableSize: 65537
      type: SourceIP
    type: ConsistentHash
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: UDPRoute
    name: route-udp-10000
status:
  ancestors:
  - ancestorRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: test-1
      namespace: test
      sectionName: listener-udp-10000
    conditions:
    - lastTransitionTime: "2026-07-20T16:40:32Z"
      message: Policy has been accepted.
      observedGeneration: 3
      reason: Accepted
      status: "True"
      type: Accepted
    controllerName: gateway.envoyproxy.io/gatewayclass-controller

贡献者指南