From 1adb15dd20c7c1d558c60a6867f4883ae5504b0b Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Wed, 14 Apr 2021 16:06:29 +0200 Subject: [PATCH] chore: some cleanup, new tools script to check cgroup memory limits --- .gitignore | 1 + kubezero-repo.GFV/repo | 1 - scripts/get_cgroup_limits.sh | 9 +++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) delete mode 160000 kubezero-repo.GFV/repo create mode 100755 scripts/get_cgroup_limits.sh diff --git a/.gitignore b/.gitignore index 3bb249ef..f590abbf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ # Breaks Helm V3 dependencies in Argo Chart.lock +kubezero-repo.??? diff --git a/kubezero-repo.GFV/repo b/kubezero-repo.GFV/repo deleted file mode 160000 index 25b8ebe3..00000000 --- a/kubezero-repo.GFV/repo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 25b8ebe3cc2af88643a4674a63e651e9c31245cb diff --git a/scripts/get_cgroup_limits.sh b/scripts/get_cgroup_limits.sh new file mode 100755 index 00000000..713c6e5c --- /dev/null +++ b/scripts/get_cgroup_limits.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +NAME=$1 + +POD_ID="$(crictl pods --name $NAME -q)" +CGROUP_PATH=$(crictl inspectp -o=json $POD_ID | jq -rc .info.runtimeSpec.linux.cgroupsPath) + +echo -n "cgroup memory limit in bytes for $NAME: " +cat /sys/fs/cgroup/memory/$(dirname $CGROUP_PATH)/memory.limit_in_bytes