 on [Unsplash](https://unsplash.com)](https://blog.sdfg.com.ar/posts/userns-in-kubernetes-implementation/cover.jpg)
User Namespaces in Kubernetes: The Implementation
This blog post is part of a series on user namespaces in Kubernetes. In the previous post, we saw how idmap mounts let containers with different userns mappings share volumes. Now let’s see what other questions we need to answer for the implementation: Who decides the mapping: the kubelet or the runtime? Kubernetes supports running different runtimes on one node, so the simplest approach is for the kubelet to decide the mappings. Otherwise, runtimes have no way to know if a range is already used by another runtime. How large should the mapping be for each pod? Most container images already use IDs up to 65535. If a UID in use is not mapped, it will be shown as the overflow id and you can’t modify it. So using 0-65535 seems like a simple choice here. The implementation The UID/GID space in Linux is 32 bits. We divide the ID space into chunks of 16 bits each: ...
 on [Unsplash](https://unsplash.com)](https://blog.sdfg.com.ar/posts/userns-in-kubernetes-mappings/cover.jpg)
 on [Unsplash](https://unsplash.com)](https://blog.sdfg.com.ar/posts/all-about-userns-in-kubernetes/cover.jpg)