Skip to content

Commit bcd9d3b

Browse files
committed
userns: Clarify volume usage
Signed-off-by: Rodrigo Campos <[email protected]>
1 parent 2703ed8 commit bcd9d3b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

content/en/docs/concepts/workloads/pods/user-namespaces.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,18 @@ The kubelet will pick host UIDs/GIDs a pod is mapped to, and will do so in a way
8484
to guarantee that no two pods on the same node use the same mapping.
8585

8686
The `runAsUser`, `runAsGroup`, `fsGroup`, etc. fields in the `pod.spec` always
87-
refer to the user inside the container.
87+
refer to the user inside the container. These users will be used for volume
88+
mounts (specified in `pod.spec.volumes`) and therefore the host UID/GID will not
89+
have any effect on writes/reads from volumes the pod can mount. In other words,
90+
the inodes created/read in volumes mounted by the pod will be the same as if the
91+
pod wasn't using user namespaces.
92+
93+
This way, a pod can easily enable and disable user namespaces (without affecting
94+
its volume's file ownerships) and can also share volumes with pods without user
95+
namespaces by just setting the appropriate users inside the container
96+
(`RunAsUser`, `RunAsGroup`, `fsGroup`, etc.). This applies to any volume the pod
97+
can mount, including `hostPath` (if the pod is allowed to mount `hostPath`
98+
volumes).
8899

89100
The valid UIDs/GIDs when this feature is enabled is the range 0-65535. This
90101
applies to files and processes (`runAsUser`, `runAsGroup`, etc.).

0 commit comments

Comments
 (0)