Skip to content

Commit 982760a

Browse files
author
Ian Campbell
committed
Expose full cgroups hierarchy to kubelet + runtime
Previously kubelet, docker and cri-containerd had their own individual private sub-hierarchies at /sys/fs/cgroups. However at least kubelet needs to be able to see the entire hosts hierarchy in order to manage things like capacity and evictions. It then seems to make sense for the runtime component (docker or cri-containerd) to also see the full hierarchy. Fixes #38. Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent 46d7ffc commit 982760a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

pkg/cri-containerd/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ config:
1616
- /run/containerd/containerd.sock:/run/containerd/containerd.sock
1717
- /var/lib/kubelet-plugins:/usr/libexec/kubernetes/kubelet-plugins:rshared,rbind
1818
mounts:
19-
- type: cgroup
20-
options: ["rw","nosuid","noexec","nodev","relatime"]
19+
- type: bind
20+
source: /sys/fs/cgroup
21+
destination: /sys/fs/cgroup
22+
options: ["rw","rbind","rshared","nosuid","noexec","nodev","relatime"]
2123
capabilities:
2224
- all
2325
rootfsPropagation: shared

pkg/kubelet/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ config:
1717
- /var/lib/cni/conf:/etc/cni/net.d:rshared,rbind
1818
- /var/lib/cni/bin:/opt/cni/bin:rshared,rbind
1919
mounts:
20-
- type: cgroup
21-
options: ["rw","nosuid","noexec","nodev","relatime"]
20+
- type: bind
21+
source: /sys/fs/cgroup
22+
destination: /sys/fs/cgroup
23+
options: ["rw","rbind","rshared","nosuid","noexec","nodev","relatime"]
2224
capabilities:
2325
- all
2426
rootfsPropagation: shared

yml/docker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ services:
55
- all
66
pid: host
77
mounts:
8-
- type: cgroup
9-
options: ["rw","nosuid","noexec","nodev","relatime"]
8+
- type: bind
9+
source: /sys/fs/cgroup
10+
destination: /sys/fs/cgroup
11+
options: ["rw","rbind","rshared","nosuid","noexec","nodev","relatime"]
1012
binds:
1113
- /dev:/dev
1214
- /etc/resolv.conf:/etc/resolv.conf

0 commit comments

Comments
 (0)