Skip to content

Commit 047e703

Browse files
increase inotify limits for multiple k8s clusters
This resolves #1178 and allows users to create multiple local Kubernetes clusters through Kind or the Cluster API Docker provider. Signed-off-by: Carlos Nunez <[email protected]>
1 parent cd504a4 commit 047e703

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

Diff for: examples/docker-rootful.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ provision:
5454
fi
5555
export DEBIAN_FRONTEND=noninteractive
5656
curl -fsSL https://get.docker.com | sh
57+
- mode: system
58+
script: |
59+
#!/bin/bash
60+
# Increase inotify limits to prevent nested Kubernetes control planes
61+
# from crash looping.
62+
set -eux -o pipefail
63+
echo 'fs.inotify.max_user_watches = 524288' >> /etc/sysctl.conf
64+
echo 'fs.inotify.max_user_instances = 512' >> /etc/sysctl.conf
65+
sysctl --system
5766
probes:
5867
- script: |
5968
#!/bin/bash

Diff for: examples/docker.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ provision:
5656
systemctl --user start dbus
5757
dockerd-rootless-setuptool.sh install
5858
docker context use rootless
59+
- mode: system
60+
script: |
61+
#!/bin/bash
62+
# Increase inotify limits to prevent nested Kubernetes control planes
63+
# from crash looping.
64+
set -eux -o pipefail
65+
echo 'fs.inotify.max_user_watches = 524288' >> /etc/sysctl.conf
66+
echo 'fs.inotify.max_user_instances = 512' >> /etc/sysctl.conf
67+
sysctl --system
5968
probes:
6069
- script: |
6170
#!/bin/bash

Diff for: examples/k3s.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ provision:
4141
script: |
4242
#!/bin/sh
4343
curl -sfL https://get.k3s.io | sh -
44-
44+
- mode: system
45+
script: |
46+
#!/bin/bash
47+
# Increase inotify limits to prevent nested Kubernetes control planes
48+
# from crash looping.
49+
set -eux -o pipefail
50+
echo 'fs.inotify.max_user_watches = 524288' >> /etc/sysctl.conf
51+
echo 'fs.inotify.max_user_instances = 512' >> /etc/sysctl.conf
52+
sysctl --system
4553
probes:
4654
- script: |
4755
#!/bin/bash

0 commit comments

Comments
 (0)