Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

cgroup2: unshare cgroup namespace for containers #1371

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

AkihiroSuda
Copy link
Member

In cgroup v1 container implementations, cgroupns is not used by default because
it was not available in the kernel until kernel 4.6 (May 2016), and the default
behavior will not change on cgroup v1 environments, because changing the
default will break compatibility and surprise users.

For cgroup v2, implementations are going to unshare cgroupns by default
so as to hide /sys/fs/cgroup from containers.

This PR enables cgroupns for containers, but pod sandboxes are untouched
because probably there is no need to do.

In cgroup v1 container implementations, cgroupns is not used by default because
it was not available in the kernel until kernel 4.6 (May 2016), and the default
behavior will not change on cgroup v1 environments, because changing the
default will break compatibility and surprise users.

For cgroup v2, implementations are going to unshare cgroupns by default
so as to hide /sys/fs/cgroup from containers.

* Discussion: containers/podman#4363
* Podman PR (merged): containers/podman#4374
* Moby PR: moby/moby#40174

This PR enables cgroupns for containers, but pod sandboxes are untouched
because probably there is no need to do.

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Jan 9, 2020

cc @giuseppe @mrunalp @saschagrunert for consistency with CRI-O

I'm not sure we should also unshare cgroupns for pod sandboxes. RFC.

@AkihiroSuda
Copy link
Member Author

/test pull-cri-containerd-node-e2e

@Random-Liu
Copy link
Member

/lgtm

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe
Copy link

cc @giuseppe @mrunalp @saschagrunert for consistency with CRI-O

thanks, I've opened a PR for CRI-O as well: cri-o/cri-o#3098

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants