Ifindal
📖 Tutorial

Kubernetes v1.36 Introduces GA User Namespaces: A New Era of Container Security

Last updated: 2026-05-01 14:32:30 Intermediate
Complete guide
Follow along with this comprehensive guide

Introduction

After years of development, Kubernetes v1.36 marks a significant milestone with the General Availability (GA) of User Namespaces support. Linux-only by nature, this feature brings robust rootless security isolation to Kubernetes workloads, addressing long-standing challenges in container security.

Kubernetes v1.36 Introduces GA User Namespaces: A New Era of Container Security

What Are User Namespaces in Kubernetes?

User Namespaces allow a process to have a different user and group ID mapping inside the container than on the host. With the GA release, the hostUsers: false option in the Pod spec enables this capability, creating a security boundary that confines container privileges to the container's own user namespace.

Key Benefits

  • Rootless Security: Even processes running as UID 0 inside the container are mapped to a non-root user on the host, mitigating privilege escalation risks.
  • Namespaced Capabilities: Capabilities like CAP_NET_ADMIN become container-local, granting administrative power over container resources without affecting the host.
  • New Use Cases: Previously, running workloads with certain privileges required fully privileged containers. Now, those workloads can operate securely within user namespaces.

The Problem with UID 0

Traditionally, a process running as root inside a container appeared as root on the host from the kernel's perspective. If an attacker exploited a kernel vulnerability or misconfigured mount, they could gain root access on the host. While various security measures exist, they don't change the underlying identity—the process still retains some 'parts' of root.

The Engine: ID-Mapped Mounts

Achieving GA required more than Kubernetes API changes; it demanded kernel support. The critical enabler was ID-mapped mounts, introduced in Linux 5.12 and refined later. Previously, mounting volumes with user namespaces forced the Kubelet to recursively chown every file, an O(n) operation that destroyed startup performance for large volumes.

With ID-mapped mounts, the kernel remaps UIDs and GIDs at mount time—no disk writes. When a volume is mounted into a Pod with User Namespaces enabled, files appear owned by UID 0 inside the container while on disk ownership remains unchanged. This is an O(1) operation, instant and efficient.

How to Use User Namespaces in Kubernetes v1.36

Enabling user namespaces is straightforward. In your Pod spec, set hostUsers: false. No changes to container images or complex configuration required. Here's an example:

apiVersion: v1
kind: Pod
metadata:
  name: isolated-workload
spec:
  hostUsers: false
  containers:
  - name: app
    image: fedora:42
    securityContext:
      runAsUser: 0

This simple opt-out from the host user namespace activates all the security benefits described above.

Internal Anchor Links to Earlier Blog Posts

For more details and demonstrations of how user namespaces mitigate CVEs rated HIGH, refer to these earlier posts:

Getting Involved

The GA release of User Namespaces is a community effort. If you're working on low-level container runtimes or rootless technologies, now is the perfect time to adopt this feature. Test it with your workloads, provide feedback, and contribute to the Kubernetes security ecosystem. For more information, join the SIG Node or check the official documentation.

Conclusion

With User Namespaces GA in Kubernetes v1.36, the platform finally delivers a mature mechanism for rootless container isolation. Combined with ID-mapped mounts, this feature unlocks new security patterns and paves the way for safer multi-tenant clusters.