---
name: containers-ts-kubectl-exec-timeout
title: Why doesn't the `kubectl exec` command automatically timeout?
description: When you use kubectl version 1.21 or later to run `kubectl exec <pod_name>`, the command does not automatically timeout.
last-updated: 2026-04-08
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/containers?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Why doesn't the `kubectl exec` command automatically timeout?
{: #ts-kubectl-exec-timeout}
{: support}

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

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

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. 
{: tsResolve}

1. [Download the binary file for `kubectl` version 1.20](https://cloud.ibm.com/docs/containers?topic=containers-cli-install&format=markdown) and rename it to `kubectl-1.20` or similar.

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

```sh
kubectl-1.20 exec <pod_name>
```
{: pre}

## Links to additional information
{: #additional-link-info}

- [`kubectl` 1.21 and containerd fail to follow `stream_idle_timeout`](https://github.com/containerd/containerd/issues/5563){: external}
- [`exec` timeout does not kick users out on `kubectl` client 1.21](https://github.com/kubernetes/kubernetes/issues/102569){: external}