Skip to content
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

Private cgroupns 2 #114

Closed
wants to merge 20 commits into from
Closed

Private cgroupns 2 #114

wants to merge 20 commits into from

Conversation

kke
Copy link
Contributor

@kke kke commented Jun 17, 2024

testing if #63 fixes github runner problems (i think there's not much left of 63 anymore)

@kke kke force-pushed the private-cgroupns-2 branch from fc824fb to ac7bfec Compare June 17, 2024 11:24
twz123 and others added 14 commits June 20, 2024 15:59
Using the host's cgroup namespace along with a writable mount of the
entire cgroup fs messes with container isolation quite a bit. The main
purpose of this is to get a writable mount of the cgroup fs inside
containers, so that init systems are able to set up their own cgroups
accordingly.

Use a different approach to achieve the same effect: Use a private
cgroup namespace. Privileged containers will automatically have write
access. A read-write mount is only performed when running non-privileged
containers.

Signed-off-by: Tom Wieczorek <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
@kke kke force-pushed the private-cgroupns-2 branch from 736a09c to 83137e8 Compare June 20, 2024 12:59
kke added 3 commits June 20, 2024 16:01
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
@@ -50,6 +53,8 @@ func NewConfigCreateCommand() *cobra.Command {
containerCmd := &opts.config.Machines[0].Spec.Cmd
cmd.Flags().StringVarP(containerCmd, "cmd", "d", *containerCmd, "The command to execute on the container")

cmd.Flags().StringSliceVarP(&opts.volumes, "volume", "v", nil, "Volumes to mount in the container")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be extracted and added as a feature.

kke added 3 commits June 26, 2024 13:59
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
Signed-off-by: Kimmo Lehto <[email protected]>
@kke
Copy link
Contributor Author

kke commented Jun 27, 2024

Solved in #121 and useful bits extracted to #123

@kke kke closed this Jun 27, 2024
@kke kke deleted the private-cgroupns-2 branch June 27, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants