Skip to content

Conversation

@seans3
Copy link
Contributor

@seans3 seans3 commented Sep 9, 2025

  • Adds requirement for new synthetic RBAC CREATE permission check for WebSocket upgrade request.
    • Feature Gate for this functionality: AuthorizePodWebsocketUpgradeCreatePermission; enabled by default
    • Beta in v1.35
  • Refactor GA/stable requirement for transitioning to streaming WebSockets from client to Kubelet (but NOT from Kubelet to container runtime).
  • Updates KEP to reflect graduating WebSockets functionality to GA in v1.36

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 9, 2025
@k8s-ci-robot k8s-ci-robot requested a review from jpbetz September 9, 2025 19:20
@k8s-ci-robot k8s-ci-robot added the kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory label Sep 9, 2025
@k8s-ci-robot k8s-ci-robot requested a review from sttts September 9, 2025 19:20
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 9, 2025
@seans3 seans3 changed the title Updated WebSockets KEP to move to GA in 1.35 KEP-4006: Updated KEP to move to GA in 1.35 Sep 9, 2025
@seans3 seans3 mentioned this pull request Sep 9, 2025
12 tasks
@seans3
Copy link
Contributor Author

seans3 commented Sep 9, 2025

/assign @liggitt
/assign @aojea

-->

1. We will not make *any* changes to current WebSocket based browser/javascript clients.
2. We will not extend the WebSockets communication leg from the API Server to Kubelet (in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is reasonable in order to avoid keeping this KEP and feature gate for longer, this has already an immediate positive impact by allowing the entire ecosystem to use websockets against the apiserver instead of a deprecated protocol like SPDY, with almost zero support for most of the load balancers causing a lot of friction.

@aojea
Copy link
Member

aojea commented Sep 9, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2025
@liggitt
Copy link
Member

liggitt commented Sep 10, 2025

I do think we should resolve the user-visible permissions change related to kubectl exec / attach / portforward - see kubernetes/kubernetes#133515 (comment)

The permissions required by kubectl changed from create to get ... I think we should consider adding a second authz check for create permission specifically to exec / attach / portforward when entering via the GET path.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 15, 2025

- `kubectl` environment variables and API Server feature gates are locked to on by default.
- Deprecate `kubectl` environment variables and API Server feature gates for future removal.
- Address RBAC authorization for WebSocket upgrades. The mechanism must be compatible with existing authorization rules for subresources (e.g., `pods/exec`) that are typically enforced on POST requests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liggitt for your comment in kubernetes/kubernetes#133515 (comment) and your code there is unclear to me if you want to rollout this authoritzation compatibility as a separate gate or making this GA but not locked by default during one cycle.

Copy link
Member

@liggitt liggitt Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a separate gate, but we can add a few sentences in this KEP about that gate and it's purpose, since it's sort of prompted by the kubectl switch to websockets.

I'd like to get that merged as a prereq for indicating work on this KEP is complete / GA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I have updated the KEP to indicate GA in 1.36.
  2. I have added a separate feature gate ForceRBACCreateCheck for the additional CREATE authz check. This functionality is a prerequisite for GA.

Please let me know what you think.

@seans3 seans3 changed the title KEP-4006: Updated KEP to move to GA in 1.35 KEP-4006: Updated KEP for 1.35 Sep 18, 2025
- Deprecate `kubectl` environment variables and API Server feature gates for future removal.
- Force synthetic RBAC `CREATE` authorization check for WebSocket upgrades on the following
subresources: `pods/exec`, `pods/attach`, and `pods/portforward`. This additional check
will be gated by the API Server `ForceRBACCreateCheck` feature flag, which defaults to
Copy link
Member

@liggitt liggitt Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd name this as specifically as possible, to indicate what it does... maybe something like AuthorizePodWebsocketUpgradeCreatePermission

Maybe describe this in a paragraph in the design details section. We'll start defaulting to true but not lock to true for a release so people can disable as a mitigation if needed short-term.

1.35: default=true, state=beta
1.36: default=true, state=ga, locked=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I have addressed this. Please let me know what you think.

The upstream connection is the same SPDY connection to the container (through the
Kubelet and CRI).

### Pre-GA: Kubelet `StreamTranslatorProxy`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore this paragraph, keep the kubelet StreamTranslatorProxy bits, drop out the container runtime websocket bits

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I have addressed this. Please let me know what you think.

@liggitt
Copy link
Member

liggitt commented Oct 2, 2025

/milestone v1.35
/label lead-opted-in

@k8s-ci-robot k8s-ci-robot added this to the v1.35 milestone Oct 2, 2025
@k8s-ci-robot k8s-ci-robot added the lead-opted-in Denotes that an issue has been opted in to a release label Oct 2, 2025
or pods/portforward subresources, the handler will perform an additional check to ensure
the user also has the create verb permission for that specific subresource. This new
authorization check will be controlled by a feature gate,
`AuthorizePodWebsocketUpgradeCreatePermission`, which will be enabled by default to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this feature gate be removed at some point in the future?. Or we'll keep it for a long time?.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a couple releases in enabled-by-default state, we'll transition it to locked on, then remove it ~3 releases after that

@aojea
Copy link
Member

aojea commented Oct 7, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2025
communication path from the client to the Kubelet. After the initial
kubectl-to-API-Server leg is stable, this proposal outlines the next phase:
transitioning the communication between the API Server and the Kubelet. This is
achieved by moving the translation logic currently in the API Server—specifically
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
achieved by moving the translation logic currently in the API Server—specifically
achieved by replicating the translation logic currently in the API Server—specifically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have addressed this issue. Please have a look.

variable associated with the feature to **OFF**. Or the features can be turned off
for all `kubectl` users communicating with a cluster by turning off the feature flags
for the API Server.
for the API Server. A cluster operator can disable the more stringent permissions for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for the API Server. A cluster operator can disable the more stringent permissions for
for the API Server. A cluster operator can temporarily disable the more stringent permissions for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have addressed this language issue. Please have a look.

@liggitt
Copy link
Member

liggitt commented Oct 7, 2025

a couple language nits, but lgtm overall

cc @enj @pmengelbert for kubernetes/kubernetes#133515 (comment) for the incorporation of the kubectl permission check into this KEP

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2025
@liggitt
Copy link
Member

liggitt commented Oct 7, 2025

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2025
alpha: "v1.29"
beta: "v1.31"
stable: "v1.32"
stable: "v1.36"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

35? Or are we waiting till spring to go GA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll wait until v1.36; we're implementing a new RBAC permissions check for WebSocket upgrades in this v1.35 release, and we'll wait one release before attempting GA.

@jpbetz
Copy link
Contributor

jpbetz commented Oct 7, 2025

/approve
For PRR

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jpbetz, liggitt, seans3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit 755a89a into kubernetes:master Oct 7, 2025
4 checks passed
@seans3 seans3 changed the title KEP-4006: Updated KEP for 1.35 KEP-4006: Synthetic RBAC create check for WebSocket request upgrade -- 1.35 Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lead-opted-in Denotes that an issue has been opted in to a release lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants