Skip to content

Websockets Do Not Work If Any Buffering Is Configured #13688

@Evesy

Description

@Evesy

kgateway version

v2.2.0

Kubernetes Version

v1.34.5

Describe the bug

When using WebSockets, if any sort of buffering is configured (e.g. a maxRequestSize on a TrafficPolicy, or inadvertently such as in #13641), websocket connections from clients hang indefinitely.

From the Envoy docs it suggests you should ensure upgrades are excluded from any buffer filters https://www.envoyproxy.io/docs/envoy/v1.34.1/intro/arch_overview/http/upgrades.html#http-upgrades

Expected Behavior

Websocket requests should successfully work

Steps to reproduce the bug

  1. Create/deploy WebSocket application
  2. Ensure ListenerPolicy with spec.default.httpSettings.upgradeConfig.enabledUpgrades: ['websocket']
  3. Verify websockets work
  4. Add TrafficPolicy with spec.buffer.maxRequestSize targetting the same Gateway/HTTPRoute
  5. Websocket connections will no longer work

Additional Environment Detail

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Triage

Relationships

None yet

Development

No branches or pull requests

Issue actions