Kubectl 执行超时

tom*_*mar 7 timeout kubernetes kubectl

如何设置 kubectl exec 命令的超时?

下面的命令不起作用

kubectl exec -it pod_name bash --requrest-timeout=0 -n test
Run Code Online (Sandbox Code Playgroud)

Web*_*ber 5

你有一个拼写错误,请尝试:

kubectl exec -it pod_name bash --request-timeout=0 -n test
Run Code Online (Sandbox Code Playgroud)

有关 request-timeout 的信息请参阅kubectl 官方文档

--request-timeout string           The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
Run Code Online (Sandbox Code Playgroud)

请注意,“0”已经是默认值。

  • 那么为什么一段时间后会从 Pod 中抛出呢? (4认同)