Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9a8c2a9

Browse files
authoredMar 22, 2025
Merge pull request kubernetes#130990 from BenTheElder/inotify-watches-kube-up
kube-up.sh: set inotify limits
2 parents dd43c3d + a264b00 commit 9a8c2a9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎cluster/gce/gci/configure-helper.sh

+18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ function setup-os-params {
6666
# /sbin/crash_reporter which is more restrictive in saving crash dumps. So for
6767
# now, set a generic core_pattern that users can work with.
6868
echo "/core.%e.%p.%t" > /proc/sys/kernel/core_pattern
69+
echo "Default max_user_watches / max_user_instances:"
70+
# ensure we have enough inotify watches for many pods, versus the OS defaults
71+
# debug before & after / defaults for comparison
72+
sysctl fs.inotify.max_user_watches
73+
sysctl fs.inotify.max_user_instances
74+
cat <<EOF > /etc/sysctl.d/inotify.conf
75+
fs.inotify.max_user_watches=65536
76+
fs.inotify.max_user_instances=8192
77+
EOF
78+
# Ubuntu vs COS, load sysctl settings now
79+
if [[ -e "/usr/lib/systemd/systemd-sysctl" ]]; then
80+
/usr/lib/systemd/systemd-sysctl
81+
else
82+
/lib/systemd/systemd-sysctl
83+
fi
84+
echo "Updated max_user_watches / max_user_instances:"
85+
sysctl fs.inotify.max_user_watches
86+
sysctl fs.inotify.max_user_instances
6987
}
7088

7189
# secure_random generates a secure random string of bytes. This function accepts

0 commit comments

Comments
 (0)
Please sign in to comment.