kubectl: kubectl follow logs stops after few seconds if there is a lot data to stdout

What happened?

A lot of running jobs generates a massive amount of log to stdout. Steps:

  1. Running K8s job that invokes a lot of lines to stdout.
  2. kubectl logs -f <podName> -n <nameSpace> Starts tailing pod output, till it stuck randomly. Note, it stuck till pod exit with a success or failure.

What did you expect to happen?

Expected result is to see all pod stdout on screen. This is not happening.

How can we reproduce it (as minimally and precisely as possible)?

  1. invokes a pod that generates a massive amount of stdout.
  2. run:

    kubectl logs -f <pod-name> -n <namespace>

  3. after a while, this is randomly duration, it stops showing output

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
Client Version: v1.28.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.7

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
$ uname -a
# Linux <hostname> 3.10.0-1160.99.1.el7.x86_64 kubernetes/kubernetes#1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux



</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 3
  • Comments: 29 (12 by maintainers)

Most upvoted comments

Agree, it looks like people does not look into stdout anymore, but on main Log servers such as Loki, Elk etc.

I am surprised that more people aren’t complaining about this 😄 This blocks me daily and I would love to help solve whatever limitation we are running into here.