本文介绍了Kubectl端口转发超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用kubectl端口转发功能时,我能够成功将端口从本地端口转发到远程端口.但是,似乎在闲置了几分钟后,连接被断开了.不知道为什么会这样.

While using kubectl port-forward function I was able to succeed in port forwarding a local port to a remote port. However it seems that after a few minutes idling the connection is dropped. Not sure why that is so.

这是用于进行端口转发的命令:

Here is the command used to portforward:

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

错误消息:

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

希望能够保持连接状态

推荐答案

似乎有5分钟的超时时间,可以用kubelet参数覆盖:

Seems there is a 5 minute timeout that can be overridden with kubelet parameters:

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

这篇关于Kubectl端口转发超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 21:17
查看更多