-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port forwarding dies after cancelling a TCP request #1620
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Maybe a duplicate of containerd/containerd#9875, but my repo may add a test scenario. |
Sorry to ask this but we just enabled websockets as the default protocol for port forwarding, which should (I think) resolve this. It graduated to Beta in 1.31 (so it's on by default) could you try upgrading to that version or running this on that version? If not you can try enabling the alpha version of the feature on a 1.30 cluster, but you need access to be able to edit the flags provided to the api-server to enable it fully.
|
I use
kubectl port-forward
to forward traffic to a service and sometimes the service is not reachable anymore. After some investigation it looks like the port forwarding cannot handle with cancelled TCP requests and the port-forwarding locks up and showed the following error message:The
kubectl
process keeps running, but the port-forwarding is dead. Restartingkubectl port-forward
brings the service back alive.I have created a very basic application (in Go) that serves a 32MiB file and it can be invoked using
curl -o /dev/null http://localhost:8080
and it will complete the download. When runningcurl http://localhost:8080
, it will cancel the download after the request, because it won't display binary data. This application works fine locally.When run in Kubernetes and using
kubectl port-forward server 8080:8080
it works fine when files are downloaded, but it locks up when a download is cancelled. It looks likekubectl
is still accepting requests on port 8080, but doesn't seem to be able to contact the pod anymore.I tested with both Kubernetes v1.30 (using a single node Kind cluster) and in Kubernetes v1.29 using AKS (MS Azure). A full ready-to-run reproduction is available on https://github.com/ramondeklein/k8s-portforward-bug.
The text was updated successfully, but these errors were encountered: