@@ -96,7 +96,6 @@ tags, and then generate with `hack/update-toc.sh`.
96
96
- [ Background: <code >PortForward</code > Subprotocol] ( #background-portforward-subprotocol )
97
97
- [ Proposal: New <code >PortForward</code > Tunneling Subprotocol Version - <code >v2.portforward.k8s.io</code >] ( #proposal-new-portforward-tunneling-subprotocol-version---v2portforwardk8sio )
98
98
- [ 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 )
100
99
- [ Test Plan] ( #test-plan )
101
100
- [ Prerequisite testing updates] ( #prerequisite-testing-updates )
102
101
- [ Unit tests] ( #unit-tests )
@@ -234,10 +233,6 @@ know that this has succeeded?
234
233
` kubectl exec ` , ` kubectl attach ` , ` kubectl cp ` , and ` kubectl port-forward ` for the
235
234
communication leg between ` kubectl ` and the API Server.
236
235
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
-
241
236
### Non-Goals
242
237
243
238
<!--
@@ -246,6 +241,8 @@ and make progress.
246
241
-->
247
242
248
243
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).
249
246
250
247
## Proposal
251
248
@@ -266,7 +263,7 @@ the current API Server proxy to translate or tunnel the `kubectl` WebSockets dat
266
263
a SPDY upstream connection. In this way, the cluster components upstream from the
267
264
API Server will not initially need to be changed. We intend to extend the communication
268
265
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 .
270
267
271
268
### User Stories (Optional)
272
269
@@ -510,23 +507,6 @@ as the downstream connection within the dual concurrent `io.Copy` proxying gorou
510
507
The upstream connection is the same SPDY connection to the container (through the
511
508
Kubelet and CRI).
512
509
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
-
530
510
### Test Plan
531
511
532
512
<!--
@@ -735,6 +715,8 @@ in back-to-back releases.
735
715
736
716
##### v1.30 RemoteCommand Subprotocol (exec, cp, and attach)
737
717
718
+ - ` kubectl ` environment variable KUBECTL_REMOTE_COMMAND_WEBSOCKETS is ** ON** by default.
719
+ - API Server feature flag ` TranslateStreamCloseWebsocketRequests ` is ** ON** by default.
738
720
- Additional ` exec ` , ` cp ` , and ` attach ` unit tests completed and enabled.
739
721
- Additional ` exec ` , ` cp ` , and ` attach ` integration tests completed and enabled.
740
722
- Additional ` exec ` , ` cp ` , and ` attach ` e2e tests completed and enabled.
@@ -754,6 +736,12 @@ in back-to-back releases.
754
736
755
737
#### GA
756
738
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** .
757
745
- Add WebSocket support for HTTPS proxies.
758
746
- See (https://github.com/kubernetes/kubernetes/issues/126134 )
759
747
- Conformance tests for ` RemoteCommand ` completed and enabled.
@@ -762,7 +750,6 @@ in back-to-back releases.
762
750
- Conformance tests for ` PortForward ` completed and enabled.
763
751
- Conformance tests for ` PortForward ` have been stable and
764
752
non-flaky for two weeks.
765
- - Extend the WebSockets communication leg from the API Server to Kubelet.
766
753
767
754
### Upgrade / Downgrade Strategy
768
755
@@ -892,6 +879,8 @@ well as the [existing list] of feature gates.
892
879
KUBECTL_REMOTE_COMMAND_WEBSOCKETS, TranslateStreamCloseWebsocketRequests
893
880
- Feature gate name(s) for PortForward Subprotocol:
894
881
KUBECTL_PORT_FORWARD_WEBSOCKETS, PortForwardWebsockets
882
+ - Feature gate name(s) for subresource endpoints ` pods/exec ` , ` pods/attach ` ,
883
+ and ` pods/portforward ` : ForceRBACCreateCheck
895
884
- Components depending on the feature gate: kubectl, API Server
896
885
897
886
###### Does enabling the feature change any default behavior?
@@ -910,7 +899,10 @@ variable set to **ON** for `exec`, `cp`, and `attach` commands. While the
910
899
KUBECTL_PORT_FORWARD_WEBSOCKETS environment variable must be set to ** ON** for
911
900
` port-forward ` command. These modifications, however, will be transparent to the
912
901
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 ` .
914
906
915
907
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
916
908
@@ -928,7 +920,9 @@ NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
928
920
The features can be disabled for a single user by setting the ` kubectl ` environment
929
921
variable associated with the feature to ** OFF** . Or the features can be turned off
930
922
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** .
932
926
933
927
###### What happens if we reenable the feature if it was previously rolled back?
934
928
@@ -957,6 +951,9 @@ https://github.com/kubernetes/kubernetes/pull/97058/files#diff-7826f7adbc1996a05
957
951
- There are unit tests in the API Server which exercise the feature gate within
958
952
the ` UpgradeAwareProxy ` , which conditionally delegates to the ` StreamTunneling `
959
953
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 ` .
960
957
961
958
### Rollout, Upgrade and Rollback Planning
962
959
@@ -1455,6 +1452,8 @@ Major milestones might include:
1455
1452
- First Kubernetes release where PortForward over WebSockets described in KEP: v1.30
1456
1453
- PortForward over WebSockets shipped as alpha: v1.30
1457
1454
- 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
1458
1457
1459
1458
## Drawbacks
1460
1459
0 commit comments