Skip to content

Commit 2037ba8

Browse files
refactor: print warning if memory.oom.group=1 (#99)
* refactor: echo `memory.oom.group` for current cgroup * refactor: print warning if singleProcessOOMKill is not defined
1 parent 5c543d8 commit 2037ba8

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

run.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,23 @@ do
189189
fi
190190

191191
echo "Starting dockerd rootless"
192-
#dockerd ${DOCKERD_PARAMS} <&- &
192+
193+
if [ ! -f /sys/fs/cgroup/cgroup.controllers ]; then
194+
echo "Using cgroup v1"
195+
else
196+
echo "Using cgroup v2"
197+
CURRENT_CGROUP=$(cat /proc/self/cgroup | sed 's/0:://')
198+
echo "Current cgroup: ${CURRENT_CGROUP}"
199+
200+
MEMORY_OOM_GROUP_VALUE=$(cat "/sys/fs/cgroup/${CURRENT_CGROUP}/memory.oom.group")
201+
echo "Current memory.oom.group value: ${MEMORY_OOM_GROUP_VALUE}"
202+
203+
if [[ "${MEMORY_OOM_GROUP_VALUE}" == "1" ]]; then
204+
echo "Warning! memory.oom.group is set to 1 for the current cgroup, OOM events will not be handled properly by the platform. \
205+
Set singleProcessOOMKill=true for kubelet configuration to fix it." 1>&2;
206+
fi
207+
fi
208+
193209
export DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="-p 0.0.0.0:1300:1300/tcp" # Expose rooltelsskit port
194210
dockerd-entrypoint.sh dockerd ${DOCKERD_PARAMS} <&- &
195211

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 3.0.2
1+
version: 3.0.3

0 commit comments

Comments
 (0)