Skip to content

Commit

Permalink
setup /kubelet.slice cgroup for systemd driver
Browse files Browse the repository at this point in the history
TODO: just setup a real systemd slice?
  • Loading branch information
BenTheElder committed May 6, 2022
1 parent 51b27ca commit d1c5998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions images/base/files/usr/local/bin/create-kubelet-cgroup-v2
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ ensure_subtree_control() {
ensure_subtree_control /
mkdir -p /sys/fs/cgroup/kubelet
ensure_subtree_control /kubelet
# again for kubelet.slice for systemd cgroup driver
mkdir -p /sys/fs/cgroup/kubelet.slice
ensure_subtree_control /kubelet.slice
2 changes: 2 additions & 0 deletions images/base/files/usr/local/bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ fix_cgroup() {
# "nesting" clusters, unless we instruct it to use a different cgroup root.
# We do this, and when doing so we must fixup this alternative root
# currently this is hardcoded to be /kubelet
# under systemd cgroup driver, kubelet appends .slice
mount --make-rprivate /sys/fs/cgroup
echo "${cgroup_subsystems}" |
while IFS= read -r subsystem; do
mount_kubelet_cgroup_root "/kubelet" "${subsystem}"
mount_kubelet_cgroup_root "/kubelet.slice" "${subsystem}"
done
}

Expand Down

0 comments on commit d1c5998

Please sign in to comment.