Kubectl port forwarding timeout issue

By using the kubectl forwarding feature, I succeeded in redirecting the local port port to the remote port. However, it seems that after a few minutes at idle, the connection is disconnected. Not sure why this is so.

Here is the command used to migrate:

kubectl --namespace somenamespace port-forward somepodname 50051:50051

Error message:

Forwarding from 127.0.0.1:50051 -> 50051
Forwarding from [::1]:50051 -> 50051
E1125 17:18:55.723715    9940 portforward.go:178] lost connection to pod

I would like to maintain a connection

+6
source share
1 answer

There seems to be a 5 minute timeout that can be overridden with parameters kubelet:

https://github.com/kubernetes/kubernetes/issues/19231

- 5 ( ) kubelets, streaming-connection-idle-timeout. . --streaming-connection-idle-timeout=4h, 4 . : --streaming-connection-idle-timeout=0, .

+1

All Articles