From 00b126ff202e478f3c2f21340cee07f6a6c7ce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Wed, 22 May 2024 21:12:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20sysctl=20demonset=20to=20f?= =?UTF-8?q?ix=20log=20streaming=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The symptom is: create fsnotify watcher: too many open files (When trying to follow logs with e.g. kubectl logs or stern.) I think this is a kubelet resource issue so the sysctl needs to be adjusted on every node - hence a DaemonSet. --- k8s/sysctl.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 k8s/sysctl.yaml diff --git a/k8s/sysctl.yaml b/k8s/sysctl.yaml new file mode 100644 index 00000000..ef72f61d --- /dev/null +++ b/k8s/sysctl.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: sysctl +spec: + selector: + matchLabels: + app: sysctl + template: + metadata: + labels: + app: sysctl + spec: + tolerations: + - operator: Exists + initContainers: + - name: sysctl + image: alpine + securityContext: + privileged: true + command: + - sysctl + - fs.inotify.max_user_instances=99999 + containers: + - name: pause + image: registry.k8s.io/pause:3.8 +