Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/environmentSetup/environmentSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ env_setup_local_cluster() {
check_resources_ok
ensure_python_venv
add_hosts

increase_inotify_params

if ! is_local_cluster_installed; then
install_k3s
$UTILS_DIR/install-k9s.sh > /dev/null 2>&1
Expand Down
28 changes: 28 additions & 0 deletions src/environmentSetup/k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,34 @@ install_k8s_tools() {
}


#------------------------------------------------------------------------------
# Function: increase_inotify_params
# Description: Increases inotify limits required for Kubernetes/container
# workloads. Without this, vnext pods hit EMFILE errors on startup.
#------------------------------------------------------------------------------
increase_inotify_params() {
log_step "Increase inotify limits for Kubernetes workloads"
local SYSCTL_FILE="/etc/sysctl.d/99-inotify.conf"

sysctl -w fs.inotify.max_user_watches=1048576 >/dev/null 2>&1 || {
log_warn "Failed to set fs.inotify.max_user_watches"
return 1
}
sysctl -w fs.inotify.max_user_instances=1024 >/dev/null 2>&1 || {
log_warn "Failed to set fs.inotify.max_user_instances"
return 1
}

cat <<EOF > "${SYSCTL_FILE}"
# Increased inotify limits for Kubernetes/container workloads
fs.inotify.max_user_watches = 1048576
fs.inotify.max_user_instances = 1024
EOF

sysctl --system >/dev/null 2>&1
log_ok
}

#------------------------------------------------------------------------------
# Function : report_cluster_info
# Description: Reports basic information about the Kubernetes cluster.
Expand Down
Loading