Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timeout for Kubectl exec

Tags:

How can I set the timeout for the kubectl exec command ?

The below command does not work

kubectl exec -it pod_name bash --requrest-timeout=0 -n test
like image 499
tomar Avatar asked Jul 11 '18 06:07

tomar


People also ask

How do I restrict kubectl exec?

To limit the ability to kubectl exec to pods what you want to do is create a custom Role & RoleBinding that removes the create verb for the pods/exec resource. An easy approach to this might be to copy the default RBAC policies, and then make the appropriate edit and rename.

What is in kubectl exec command?

The kubectl exec command lets you start a shell session inside containers running in your Kubernetes cluster. This command lets you inspect the container's file system, check the state of the environment, and perform advanced debugging tools when logs alone don't provide enough information.

How do I increase timeout in Kubernetes?

Unfortunately, there is no way to make it faster. A lot of actions are supposed to be done by Kubernetes to restart pods from a failed node. However, it is possible to enhance reaction time. For example, reduce the value of node-monitor-grace-period, default is 40 seconds.

What is streaming connection idle timeout?

Rationale: Setting idle timeouts ensures that you are protected against Denial-of-Service attacks, inactive connections and running out of ephemeral ports. Note: By default, --streaming-connection-idle-timeout is set to 4 hours which might be too high for your environment.


1 Answers

You have a typo, try:

kubectl exec -it pod_name bash --request-timeout=0 -n test

See kubectl official documentation about request-timeout

--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")

Note that "0" is already the default.

like image 169
Webber Avatar answered Sep 28 '22 19:09

Webber