Staging instance, all changes can be removed at any time

Skip to content

kubernetes: Define sysctl inotify.max_user_instances to 8192

Guillaume Samson requested to merge kubernetes_inotify_max into production

The service user@0.service was in failed state on node metal01 and node metal02:

Dec 12 18:48:23 rancher-node-metal01 systemd[1]: Starting User Manager for UID 0...                                
Dec 12 18:48:23 rancher-node-metal01 systemd[339762]: pam_unix(systemd-user:session): session opened for user root(uid=0) by (uid=0)
Dec 12 18:48:23 rancher-node-metal01 systemd[339762]: Failed to create control group inotify object: Too many open files       
Dec 12 18:48:23 rancher-node-metal01 systemd[339762]: Failed to allocate manager object: Too many open files                                                                                                                                                  
Dec 12 18:48:23 rancher-node-metal01 systemd[1]: user@0.service: Main process exited, code=exited, status=1/FAILURE
Dec 12 18:48:23 rancher-node-metal01 systemd[1]: user@0.service: Failed with result 'exit-code'.
Dec 12 18:48:23 rancher-node-metal01 systemd[1]: Failed to start User Manager for UID 0.

This modification will define the kernel parameter fs.inotify.max_user_instances to 8192.

Octocatalog diff (metal01)
ᐅ bin/octocatalog-diff -f production -t kubernetes_inotify_max rancher-node-metal01           
Found host rancher-node-metal01.internal.softwareheritage.org
Cloning into '/tmp/swh-ocd.xbgWx9uV/swh-site'...
done.
branch 'kubernetes_inotify_max' set up to track 'origin/kubernetes_inotify_max'.
Switched to a new branch 'kubernetes_inotify_max'
branch 'mr/puppet-7-compat' set up to track 'origin/mr/puppet-7-compat'.
Switched to a new branch 'mr/puppet-7-compat'
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
Auto-merging Puppetfile
[production 6be1a5cb] WIP: Update Puppetfile for compatibility with Puppet 7
 Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
 Date: Mon Nov 28 14:17:01 2022 +0100
 1 file changed, 7 insertions(+), 1 deletion(-)
Switched to branch 'kubernetes_inotify_max'
Your branch is up to date with 'origin/kubernetes_inotify_max'.
Auto-merging Puppetfile
[kubernetes_inotify_max 9113c6e7] WIP: Update Puppetfile for compatibility with Puppet 7
 Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
 Date: Mon Nov 28 14:17:01 2022 +0100
 1 file changed, 7 insertions(+), 1 deletion(-)
WARN     -> Branch mr/puppet-7-compat filtered out by ignore_branch_prefixes ["mr/puppet-7-compat"]
WARN     -> Branch mr/puppet-7-compat filtered out by ignore_branch_prefixes ["mr/puppet-7-compat"]
Cloning into '/tmp/swh-ocd.xbgWx9uV/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.xbgWx9uV/environments/kubernetes_inotify_max/data/private'...
done.
*** Running octocatalog-diff on host rancher-node-metal01.internal.softwareheritage.org
I, [2023-12-13T10:37:03.137144 #131244]  INFO -- : Catalogs compiled for rancher-node-metal01.internal.softwareheritage.org
I, [2023-12-13T10:37:03.319541 #131244]  INFO -- : Diffs computed for rancher-node-metal01.internal.softwareheritage.org
diff origin/production/rancher-node-metal01.internal.softwareheritage.org current/rancher-node-metal01.internal.softwareheritage.org
*******************************************
+ Exec[enforce-sysctl-value-fs.inotify.max_user_instances] =>
   parameters =>
     "command": "/sbin/sysctl -w fs.inotify.max_user_instances=8192",
     "unless": "/usr/bin/test \"$(/sbin/sysctl -n fs.inotify.max_user_instances)\...
*******************************************
+ Exec[sysctl-fs.inotify.max_user_instances] =>
   parameters =>
     "command": "sysctl -p /etc/sysctl.d/fs.inotify.max_user_instances.conf",
     "path": [
       "/usr/sbin",
       "/sbin",
       "/usr/bin",
       "/bin"
     ],
     "refreshonly": true
*******************************************
+ Exec[update-sysctl.conf-fs.inotify.max_user_instances] =>
   parameters =>
     "command": "sed -i -e 's#^fs.inotify.max_user_instances *=.*#fs.inotify.max_...
     "onlyif": "grep -E '^fs.inotify.max_user_instances *=' /etc/sysctl.conf",
     "path": [
       "/usr/sbin",
       "/sbin",
       "/usr/bin",
       "/bin"
     ],
     "refreshonly": true
*******************************************
+ File[/etc/sysctl.d/fs.inotify.max_user_instances.conf] =>
   parameters =>
     "content": "fs.inotify.max_user_instances = 8192\n",
     "group": "root",
     "mode": "0644",
     "notify": [
       "Exec[sysctl-fs.inotify.max_user_instances]",
       "Exec[update-sysctl.conf-fs.inotify.max_user_instances]"
     ],
     "owner": "root"
*******************************************
+ Sysctl[fs.inotify.max_user_instances] =>
   parameters =>
     "enforce": true,
     "suffix": ".conf",
     "value": 8192
*******************************************
  Sysctl[vm.max_map_count] =>
   parameters =>
     value =>
      - "2097152"
      + 2097152
*******************************************
*** End octocatalog-diff on rancher-node-metal01.internal.softwareheritage.org

Merge request reports

Loading