-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add container's cgroup readonly mount documentation. #65
Conversation
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
See #62 |
The container should only have /sys/fs/cgroup if it mounts sysfs at
/sys. That's the current default for runc:
$ runc spec
…
{
"type": "sysfs",
"source": "sysfs",
"destination": "/sys",
"options": "nosuid,noexec,nodev"
}
…
but I don't see sysfs mentioned in the specs yet.
|
I don't think I agree with this change. My understanding, from talking to many people, is that the only correct way to make this work is to bind mount the host cgroup hierarchy here and then optionally bind mount the container tree read-write. The problem is that cgroups do not use relative paths in a number of places. Also I am certain that we will want a read-write subtree to support use cases like pods. cc @vmarmol @rjnagal |
you can have it RW as well and properly nest in the correct cgroup because it's a subtree for the container. |
I am not opposed to making it RW. |
For context here is how we use the cgroup hierarchy in This explanation provides concrete examples. So, could either of you (@mrunalp or @crosbymichael) contrast that with what you are proposing here? |
@philips
|
What do you mean with the container's own cgroups? If you mean that you mount a sub-tree of the cgroup, this will not work because Systemd requires the paths in |
@mrunalp i would vote we don't have this as a default yet since there are so many ways of doing it. @alban the paths for /proc/$PID/cgroup and /sys/fs/cgroup is a good argument for not doing this but I don't think much in that linked document apply because their recommendations are very insecure just make systemd work they way they want it to work. |
@crosbymichael I agree. |
@crosbymichael It seems like we should finish this discussion about sub-tree vs. non-subtree mapping and if we need to define an environment variable. I am fine saying the cgroup tree is RO, for now, but I would like to figure this tree stuff out here for @mrunalp's use case of a process wanting to know its own cgroups. |
@mrunalp Maybe you could open an issue for discussion? |
Signed-off-by: Mrunal Patel mrunalp@gmail.com