kubernetes: APIServerTracing causing huge memory consumption/memory leak

What happened?

Since updating from Kubernetes 1.26.* to 1.29.* we experiences OOM-Kills on control plane nodes. After some investigation we found that adding --feature-gates=APIServerTracing=false to the kube-apiserver fixed the issue. (Found this via pprof/heap of one apiserver: heap dump could be added if needed)

Before the update to 1.29.* the control planes were running with 4GB of memory with the same worklow in the cluster without issues. After the workarround using the feature gate the memory consumption of the whole control plane is not at ~2GB.

What did you expect to happen?

In case there is an issue with other components, memory consumption of the apiserver should not be that excessive.

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

We just had the K8s cluster running and saw a permant increase in memory usage of the control plane nodes. And after some time (can not give a specific duration) the OS of the control plane node started to OOM kill processes.

Anything else we need to know?

Let us know if you need additional information.

Kubernetes version

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

Cloud provider

on-premise; control-planes are running with 4 CPU cores, 8GB of memory and and NVME discs

OS version

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ uname -a
Linux kube-master01-003 5.10.0-32-cloud-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 GNU/Linux

Install tools

$ kubeadm version -o yaml
clientVersion:
  buildDate: "2024-04-16T15:05:51Z"
  compiler: gc
  gitCommit: 55019c83b0fd51ef4ced8c29eec2c4847f896e74
  gitTreeState: clean
  gitVersion: v1.29.4
  goVersion: go1.21.9
  major: "1"
  minor: "29"
  platform: linux/amd64

Container runtime (CRI) and version (if applicable)

$ crictl version
Version:  0.1.0
RuntimeName:  containerd
RuntimeVersion:  1.6.31
RuntimeApiVersion:  v1

Related plugins (CNI, CSI, …) and versions (if applicable)

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (14 by maintainers)

Most upvoted comments

We need to apply the workaround in https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5190. It should be simple, but needs to be backported to 1.27