Skip to content

Migrate kubectl exec from using SPDY to using WebSockets with SPDY as fallback#1980

Open
andyvandy wants to merge 1 commit intoloft-sh:mainfrom
andyvandy:main
Open

Migrate kubectl exec from using SPDY to using WebSockets with SPDY as fallback#1980
andyvandy wants to merge 1 commit intoloft-sh:mainfrom
andyvandy:main

Conversation

@andyvandy
Copy link
Copy Markdown

I've added websocket support since I want to setup a capsule kube api proxy which was dropping connections due to lack of SPDY support.

Per KEP-4006, I prioritize trying WebSockets first given Websockets have been the default for 4 versions now and will be the standard going forward. I used NewFallbackExecutor as suggested in the KEP to avoid breaking existing use cases.

This follows the implementation used by kubectl: https://github.com/kubernetes/kubectl/blob/8144b746a47f142759a073a46f581de92b1886aa/pkg/cmd/exec/exec.go#L146-L166

I've built this locally and have been using it successfully for myself and a few others. Disclosure: this fix was found with the assistance of claude/copilot.

Per [KEP-4006](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/4006-transition-spdy-to-websockets), prioritize trying WebSockets first
given it has been the default for 4 versions now and will be the standard going forward.
Use a NewFallbackExecutor as is suggested in the KEP to avoid breaking existing use cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant