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

Add user namespace support for systemd containers #28

Open
r10r opened this issue Feb 13, 2021 · 1 comment
Open

Add user namespace support for systemd containers #28

r10r opened this issue Feb 13, 2021 · 1 comment
Milestone

Comments

@r10r
Copy link
Contributor

r10r commented Feb 13, 2021

Running containers with systemd as init system currently requires privileged:true to be set in the containers SecurityContext. The container will by default run in the user namespace of the host.

Since process limits are set per user namespace, changing process limits in the container will affect the host.

https://systemd.io/CONTAINER_INTERFACE/#fully-unprivileged-container-payload

cri-o has added support for UID mappings (since TODO) in /etc/crio/crio.conf and sets them to the OCI runtime spec
LinuxIDMapping

# The UID mappings for the user namespace of each container. A range is
# specified in the form containerUID:HostUID:Size. Multiple ranges must be
# separated by comma.
uid_mappings = ""

# The GID mappings for the user namespace of each container. A range is
# specified in the form containerGID:HostGID:Size. Multiple ranges must be
# separated by comma.
gid_mappings = ""

crio-lxc in turn uses the mapping from the runtime spec to set lxc.idmap in the container config.

Currently I did not manage to get a plain lxc container running in user namespaces.
See lxc/lxc#3669

@r10r
Copy link
Contributor Author

r10r commented Feb 13, 2021

@r10r r10r transferred this issue from another repository Mar 24, 2021
@r10r r10r transferred this issue from another repository Apr 8, 2021
@r10r r10r added this to the lxcri v1.0.0 milestone Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant