-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add process to init subcgroup when we're using dind with cgroups v2 #10845
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
Conversation
fe9c4d6
to
922eabb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @antoine-gaillard!
@antoine-gaillard, we need you to actually add a descriptive commit message as part of your commit and also add your |
922eabb
to
afa4884
Compare
@fidencio thanks for looking at it, it should be good now |
cgroups v2 enforces stricter delegation rules, preventing operations on cgroups outside our ownership boundary. When running Docker-in-Docker (DinD), processes must be attached to an "init" subcgroup within the systemd unit. This fix detects and uses the init subcgroup when proxying process attachment. Fixes kata-containers#10733 Signed-off-by: Antoine Gaillard <antoine.gaillard@datadoghq.com>
afa4884
to
4b5b788
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @antoine-gaillard!
When running systemd in container, processes should be attached to "init.scope". systemd fixedly use "init.scope" as delegate sub-cgroup name, and the name cannot be changed. This is a supplement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
When running systemd in container, processes should be attached to "init.scope". systemd fixedly use "init.scope" as delegate sub-cgroup name, and the name cannot be changed. This is a supplement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
When running systemd in container, processes should be attached to "init.scope". systemd fixedly use "init.scope" as delegate sub-cgroup name, and the name cannot be changed. This is a supplement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
When running systemd in container, processes should be attached to "init.scope". systemd fixedly use "init.scope" as delegate sub-cgroup name, and the name cannot be changed. This is a supplement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
When running systemd in container, processes should be attached to "init.scope". systemd fixedly use "init.scope" as delegate sub-cgroup name, and the name cannot be changed. This is a supplement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This method can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This method can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
Using a fixed sub cgroup name "init" only supports the DinD (Docker-in-Docker) scenario. A more elegant approach is to obtain the path of the sub-cgroup based on the cgroup path of the first process in the container. This patch can support that init process running in sub-cgroup with any names, including but not limited to systemd (init.scope), even if the user moves the cgroup of the init process after the container starts running. This is a enhancement for PR kata-containers#10845. Fixes kata-containers#10733 Signed-off-by: mchtech <michu_an@126.com>
This is a fix for issue #10733