From 01facc8ee63a813b0ccbeab522c8905230ae92f8 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 29 Jan 2025 15:09:31 -0500 Subject: [PATCH 1/3] preflight for at least 1000 fs.inotify.max_user_instances --- pkg/preflights/host-preflight.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/preflights/host-preflight.yaml b/pkg/preflights/host-preflight.yaml index 091e0fddec..b6e7109505 100644 --- a/pkg/preflights/host-preflight.yaml +++ b/pkg/preflights/host-preflight.yaml @@ -901,6 +901,15 @@ spec: - pass: when: 'net.ipv4.ip_forward > 0' message: "IP forwarding is enabled." + - sysctl: + checkName: "Adequate inotify max_user_instances" + outcomes: + - fail: + when: 'fs.inotify.max_user_instances < 1000' + message: "Inadequate inotify max_user_instances. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_instances' to a value of at least 1000, and run 'sudo sysctl -p'." + - pass: + when: 'fs.inotify.max_user_instances > 999' + message: "Adequate inotify max_user_instances." - networkNamespaceConnectivity: collectorName: check-network-namespace-connectivity outcomes: From b63b59f296eea1bdb0a7e1f13efa241c0a105aff Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 29 Jan 2025 15:27:45 -0500 Subject: [PATCH 2/3] update value to 8192, add max_user_watches --- pkg/preflights/host-preflight.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/preflights/host-preflight.yaml b/pkg/preflights/host-preflight.yaml index b6e7109505..c957f743bd 100644 --- a/pkg/preflights/host-preflight.yaml +++ b/pkg/preflights/host-preflight.yaml @@ -905,11 +905,20 @@ spec: checkName: "Adequate inotify max_user_instances" outcomes: - fail: - when: 'fs.inotify.max_user_instances < 1000' - message: "Inadequate inotify max_user_instances. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_instances' to a value of at least 1000, and run 'sudo sysctl -p'." + when: 'fs.inotify.max_user_instances < 8192' + message: "Inadequate inotify max_user_instances. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_instances' to a value of at least 8192, and run 'sudo sysctl -p'." - pass: - when: 'fs.inotify.max_user_instances > 999' + when: 'fs.inotify.max_user_instances > 8191' message: "Adequate inotify max_user_instances." + - sysctl: + checkName: "Adequate inotify max_user_watches" + outcomes: + - fail: + when: 'fs.inotify.max_user_watches < 8192' + message: "Inadequate inotify max_user_watches. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_watches' to a value of at least 8192, and run 'sudo sysctl -p'." + - pass: + when: 'fs.inotify.max_user_watches > 8191' + message: "Adequate inotify max_user_watches." - networkNamespaceConnectivity: collectorName: check-network-namespace-connectivity outcomes: From 7d574c1416a15b555d8691fc5eed862082749415 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 29 Jan 2025 15:57:24 -0500 Subject: [PATCH 3/3] 1024 due to CI limits --- pkg/preflights/host-preflight.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/preflights/host-preflight.yaml b/pkg/preflights/host-preflight.yaml index c957f743bd..1bc5cba3be 100644 --- a/pkg/preflights/host-preflight.yaml +++ b/pkg/preflights/host-preflight.yaml @@ -905,19 +905,19 @@ spec: checkName: "Adequate inotify max_user_instances" outcomes: - fail: - when: 'fs.inotify.max_user_instances < 8192' - message: "Inadequate inotify max_user_instances. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_instances' to a value of at least 8192, and run 'sudo sysctl -p'." + when: 'fs.inotify.max_user_instances < 1024' + message: "Inadequate inotify max_user_instances. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_instances' to a value of at least 1024, and run 'sudo sysctl -p'." - pass: - when: 'fs.inotify.max_user_instances > 8191' + when: 'fs.inotify.max_user_instances > 1023' message: "Adequate inotify max_user_instances." - sysctl: checkName: "Adequate inotify max_user_watches" outcomes: - fail: - when: 'fs.inotify.max_user_watches < 8192' - message: "Inadequate inotify max_user_watches. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_watches' to a value of at least 8192, and run 'sudo sysctl -p'." + when: 'fs.inotify.max_user_watches < 1024' + message: "Inadequate inotify max_user_watches. To enable it, edit /etc/sysctl.conf, add or edit 'fs.inotify.max_user_watches' to a value of at least 1024, and run 'sudo sysctl -p'." - pass: - when: 'fs.inotify.max_user_watches > 8191' + when: 'fs.inotify.max_user_watches > 1023' message: "Adequate inotify max_user_watches." - networkNamespaceConnectivity: collectorName: check-network-namespace-connectivity