Skip to content

Commit

Permalink
Addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
seans3 committed Aug 12, 2024
1 parent baf5164 commit dc39e49
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions content/en/blog/_posts/2024-08-20-websocket-transition.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ no longer support the protocol. As a result, you might notice that commands like
`kubectl cp`, `kubectl attach`, `kubectl exec`, and `kubectl port-forward`
stop working when you try to access your cluster through a proxy or gateway.

As of Kubernetes v1.31, we've modified the streaming protocol that a Kubernetes
client (such as `kubectl`) uses for these commands to the more modern
[WebSocket streaming protocol](https://datatracker.ietf.org/doc/html/rfc6455).
As of Kubernetes v1.31, SIG API Machinery have modified the streaming
protocol that a Kubernetes client (such as `kubectl`) uses for these commands
to the more modern [WebSocket streaming protocol](https://datatracker.ietf.org/doc/html/rfc6455).
The WebSocket protocol is a currently supported standardized streaming protocol
that guarantees compatibility and interoperability with different components and
programming languages. The WebSocket protocol is more widely supported by modern
Expand All @@ -57,7 +57,7 @@ Request Headers:
Connection: Upgrade
Upgrade: websocket
Sec-Websocket-Protocol: v5.channel.k8s.io
User-Agent: kubectl/v1.30.1 (linux/amd64) kubernetes/6911225
User-Agent: kubectl/v1.31.0 (linux/amd64) kubernetes/6911225
```

If the container runtime supports the WebSocket streaming protocol and at least
Expand All @@ -75,9 +75,9 @@ Response Headers:
```

At this point the TCP connection used for the HTTP protocol has changed to a
streaming connection. Subsequent STDIN, STDOUT, and STDERR data (as well as TTY
and process exit code data) for this shell interaction is then streamed over this
upgraded connection.
streaming connection. Subsequent STDIN, STDOUT, and STDERR data (as well as
terminal resizing data and process exit code data) for this shell interaction is
then streamed over this upgraded connection.

## How to use the new WebSocket streaming protocol

Expand All @@ -102,9 +102,11 @@ default:
- `kubectl port-forward`

If you're connecting to an older cluster but can manage the feature gate
settings, turn on `TranslateStreamCloseWebsocketRequests` (available in
Kubernetes v1.29) and `PortForwardWebsockets` (available in Kubernetes
v1.30) to try this new behavior.
settings, turn on both `TranslateStreamCloseWebsocketRequests` (added in
Kubernetes v1.29) and `PortForwardWebsockets` (added in Kubernetes
v1.30) to try this new behavior. Version 1.31 of `kubectl` can automatically use
the new behavior, but you do need to connect to a cluster where the server-side
features are explicitly enabled.

## Learn more about streaming APIs

Expand Down

0 comments on commit dc39e49

Please sign in to comment.