Skip to content

Commit aefcf65

Browse files
committed
Updated WebSockets KEP to move to GA in 1.35
1 parent 6733cbd commit aefcf65

File tree

3 files changed

+32
-28
lines changed

3 files changed

+32
-28
lines changed

keps/prod-readiness/sig-api-machinery/4006.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ alpha:
33
approver: "@deads2k"
44
beta:
55
approver: "@jpbetz"
6+
stable:
7+
approver: "@jpbetz"

keps/sig-api-machinery/4006-transition-spdy-to-websockets/README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ tags, and then generate with `hack/update-toc.sh`.
9696
- [Background: <code>PortForward</code> Subprotocol](#background-portforward-subprotocol)
9797
- [Proposal: New <code>PortForward</code> Tunneling Subprotocol Version - <code>v2.portforward.k8s.io</code>](#proposal-new-portforward-tunneling-subprotocol-version---v2portforwardk8sio)
9898
- [Proposal: API Server PortForward -- Stream Tunnel Proxy](#proposal-api-server-portforward----stream-tunnel-proxy)
99-
- [Pre-GA: Kubelet <code>StreamTranslatorProxy</code>](#pre-ga-kubelet-streamtranslatorproxy)
10099
- [Test Plan](#test-plan)
101100
- [Prerequisite testing updates](#prerequisite-testing-updates)
102101
- [Unit tests](#unit-tests)
@@ -234,10 +233,6 @@ know that this has succeeded?
234233
`kubectl exec`, `kubectl attach`, `kubectl cp`, and `kubectl port-forward` for the
235234
communication leg between `kubectl` and the API Server.
236235

237-
2. Extend the WebSockets communication leg from the API Server to Kubelet. After this
238-
extension, WebSockets streaming will occur between `kubectl` and Kubelet (proxied
239-
through the API Server). This plan is described at [Pre-GA: Kubelet](#pre-ga-kubelet-).
240-
241236
### Non-Goals
242237

243238
<!--
@@ -246,6 +241,8 @@ and make progress.
246241
-->
247242

248243
1. We will not make *any* changes to current WebSocket based browser/javascript clients.
244+
2. We will not extend the WebSockets communication leg from the API Server to Kubelet (in
245+
this KEP).
249246

250247
## Proposal
251248

@@ -266,7 +263,7 @@ the current API Server proxy to translate or tunnel the `kubectl` WebSockets dat
266263
a SPDY upstream connection. In this way, the cluster components upstream from the
267264
API Server will not initially need to be changed. We intend to extend the communication
268265
path for WebSockets streaming from `kubectl` to Kubelet once the the initial leg
269-
is proven to work (i.e. that it goes GA).
266+
is proven to work (i.e. that it goes GA), but it will be in another KEP.
270267

271268
### User Stories (Optional)
272269

@@ -510,23 +507,6 @@ as the downstream connection within the dual concurrent `io.Copy` proxying gorou
510507
The upstream connection is the same SPDY connection to the container (through the
511508
Kubelet and CRI).
512509

513-
### Pre-GA: Kubelet `StreamTranslatorProxy`
514-
515-
The eventual plan is to incrementally transition all SPDY communication legs to WebSockets.
516-
After the WebSocket communication leg from `kubectl` to the API Server is proven
517-
to work, the next communication leg to transition is the one from the API Server to
518-
the Kubelet. Both the API Server and the Kubelet stream data messages using the
519-
`UpgradeAwareProxy`. Since the initial plan is to modify the `UpgradeAwareProxy`
520-
in the API Server to delegate to the `StreamTranslatorProxy`, it will be straightforward
521-
to transition this next communication leg by moving the integrated `StreamTranslatorProxy`
522-
from the API Server to the Kubelet.
523-
524-
The final communication leg to transition from SPDY to WebSockets will be the one
525-
from Kubelet to the Container Runtimes. Since this communication happens within a
526-
node (using Unix domain sockets), this path is not as critical. But this effort
527-
will be more work, since it will require modifying not just Kubelet, but **all**
528-
Container Runtimes.
529-
530510
### Test Plan
531511

532512
<!--
@@ -735,6 +715,8 @@ in back-to-back releases.
735715

736716
##### v1.30 RemoteCommand Subprotocol (exec, cp, and attach)
737717

718+
- `kubectl` environment variable KUBECTL_REMOTE_COMMAND_WEBSOCKETS is **ON** by default.
719+
- API Server feature flag `TranslateStreamCloseWebsocketRequests` is **ON** by default.
738720
- Additional `exec`, `cp`, and `attach` unit tests completed and enabled.
739721
- Additional `exec`, `cp`, and `attach` integration tests completed and enabled.
740722
- Additional `exec`, `cp`, and `attach` e2e tests completed and enabled.
@@ -754,6 +736,12 @@ in back-to-back releases.
754736

755737
#### GA
756738

739+
- `kubectl` environment variables and API Server feature gates are locked to on by default.
740+
- Deprecate `kubectl` environment variables and API Server feature gates for future removal.
741+
- Force synthetic RBAC `CREATE` authorization check for WebSocket upgrades on the following
742+
subresources: `pods/exec`, `pods/attach`, and `pods/portforward`. This additional check
743+
will be gated by the API Server `ForceRBACCreateCheck` feature flag, which defaults to
744+
**TRUE**.
757745
- Add WebSocket support for HTTPS proxies.
758746
- See (https://github.com/kubernetes/kubernetes/issues/126134)
759747
- Conformance tests for `RemoteCommand` completed and enabled.
@@ -762,7 +750,6 @@ in back-to-back releases.
762750
- Conformance tests for `PortForward` completed and enabled.
763751
- Conformance tests for `PortForward` have been stable and
764752
non-flaky for two weeks.
765-
- Extend the WebSockets communication leg from the API Server to Kubelet.
766753

767754
### Upgrade / Downgrade Strategy
768755

@@ -892,6 +879,8 @@ well as the [existing list] of feature gates.
892879
KUBECTL_REMOTE_COMMAND_WEBSOCKETS, TranslateStreamCloseWebsocketRequests
893880
- Feature gate name(s) for PortForward Subprotocol:
894881
KUBECTL_PORT_FORWARD_WEBSOCKETS, PortForwardWebsockets
882+
- Feature gate name(s) for subresource endpoints `pods/exec`, `pods/attach`,
883+
and `pods/portforward`: ForceRBACCreateCheck
895884
- Components depending on the feature gate: kubectl, API Server
896885

897886
###### Does enabling the feature change any default behavior?
@@ -910,7 +899,10 @@ variable set to **ON** for `exec`, `cp`, and `attach` commands. While the
910899
KUBECTL_PORT_FORWARD_WEBSOCKETS environment variable must be set to **ON** for
911900
`port-forward` command. These modifications, however, will be transparent to the
912901
user unless the `kubectl`/API Server communication is communicating through an
913-
intermediary such as a proxy (which is the whole reason for the feature).
902+
intermediary such as a proxy (which is the whole reason for the feature). The API Server
903+
feature flag `ForceRBACCreateCheck` forces a synthetic, secondary RBAC check for the `CREATE`
904+
verb permission on WebSocket upgrade requests. When this feature gate is **TRUE**, the additional
905+
permission check will apply to endpoints `pods/exec`, `pods/attach`, and `pods/portforward`.
914906

915907
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
916908

@@ -928,7 +920,9 @@ NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
928920
The features can be disabled for a single user by setting the `kubectl` environment
929921
variable associated with the feature to **OFF**. Or the features can be turned off
930922
for all `kubectl` users communicating with a cluster by turning off the feature flags
931-
for the API Server.
923+
for the API Server. A cluster operator can disable the more stringent permissions for
924+
subresources `pods/exec`, `pods/attach`, and `pods/portforward` by setting the
925+
`ForceRBACCreateCheck` feature flag to **FALSE**.
932926

933927
###### What happens if we reenable the feature if it was previously rolled back?
934928

@@ -957,6 +951,9 @@ https://github.com/kubernetes/kubernetes/pull/97058/files#diff-7826f7adbc1996a05
957951
- There are unit tests in the API Server which exercise the feature gate within
958952
the `UpgradeAwareProxy`, which conditionally delegates to the `StreamTunneling`
959953
proxy for the PortForward subprotocol.
954+
- There will be unit tests in the API Server to verify the feature gate
955+
forcing more stringent RBAC checks for `pods/exec`, `pods/attach`, and
956+
`pods/portforward`.
960957

961958
### Rollout, Upgrade and Rollback Planning
962959

@@ -1455,6 +1452,8 @@ Major milestones might include:
14551452
- First Kubernetes release where PortForward over WebSockets described in KEP: v1.30
14561453
- PortForward over WebSockets shipped as alpha: v1.30
14571454
- PortForward over WebSockets shipped as beta: v1.31
1455+
- WebSocket HTTPS Proxy functionality shipped: v1.33
1456+
- Synthetic RBAC `CREATE` authz check for WebSocket upgrade requests: v1.35
14581457

14591458
## Drawbacks
14601459

keps/sig-api-machinery/4006-transition-spdy-to-websockets/kep.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ stage: beta
2222
# The most recent milestone for which work toward delivery of this KEP has been
2323
# done. This can be the current (upcoming) milestone, if it is being actively
2424
# worked on.
25-
latest-milestone: "v1.31"
25+
latest-milestone: "v1.35"
2626

2727
# The milestone at which this feature was, or is targeted to be, at each stage.
2828
milestone:
2929
alpha: "v1.29"
3030
beta: "v1.31"
31-
stable: "v1.32"
31+
stable: "v1.36"
3232

3333
# The following PRR answers are required at alpha release
3434
# List the feature gate name and the components for which it must be enabled
@@ -45,6 +45,9 @@ feature-gates:
4545
- name: PortForwardWebsockets
4646
components:
4747
- kube-apiserver
48+
- name: ForceRBACCreateCheck
49+
components:
50+
- kube-apiserver
4851
disable-supported: true
4952

5053
# The following PRR answers are required at beta release.

0 commit comments

Comments
 (0)