IBM Cloud Docs
Why doesn't the kubectl exec command automatically timeout?

Why doesn't the kubectl exec command automatically timeout?

When you use kubectl version 1.21 or later to run kubectl exec <pod_name>, the command does not automatically timeout.

There is a known issue that prevents the kubectl exec <pod_name> command from timing out in kubectl versions 1.21 and later.

For clusters that run on Kubernetes version 1.21 or later, run the kubectl exec command with kubectl version 1.20. To run all other commands, use the kubectl version that matches the major.minor version of your Kubernetes cluster.

  1. Download the binary file for kubectl version 1.20 and rename it to kubectl-1.20 or similar.

  2. To run kubectl exec, refer to the renamed 1.20 version.

kubectl-1.20 exec <pod_name>