AlinsRan opened a new pull request, #2863: URL: https://github.com/apache/apisix-ingress-controller/pull/2863
### Type of change: - [x] Documentation ### What this PR does / why we need it: There is no documented way to enable WebSocket with Gateway API, and the natural assumption, that an `HTTPRoute` proxying a WebSocket backend just works, produces a silent failure: the upgrade request is answered with a normal `200` instead of `101 Switching Protocols`, and nothing in the route status explains it because the route itself is valid. The switch is `appProtocol` on the backend Service port. `translateBackendRef` reads it and sets `EnableWebsocket` when it is `kubernetes.io/ws` or `kubernetes.io/wss`, and `appProtocolToUpstreamScheme` uses the same value to pick the upstream scheme. Adding it to an existing Service is enough; the `HTTPRoute` does not change. The three resources each declare it differently, which is the other half of the confusion: | Resource | How WebSocket is enabled | |---|---| | `HTTPRoute` | Service port `appProtocol: kubernetes.io/ws` or `kubernetes.io/wss` | | `ApisixRoute` | `spec.http[].websocket: true` | | `Ingress` | `k8s.apisix.apache.org/enable-websocket` annotation, or the Service `appProtocol` | This PR adds a "Proxying WebSocket" section to the Gateway API concept page covering all three, and cross-links it from the `enable-websocket` annotation reference. It also records two behaviors that come up when verifying a change: switching the backend only affects connections opened afterwards, and deleting the `HTTPRoute` does not terminate connections that are already open. No behavior change. ### Pre-submission checklist: - [x] Did you explain what problem does this PR solve? Or what new features have been added? - [ ] Have you added corresponding test cases? - [x] Have you modified the corresponding document? - [x] Is this PR backward compatible? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
