Skip to content

Commit a0f6d32

Browse files
committed
content: Fix typo in userns example
We were showing 4294967295 for the uid_map file, that is how it looks on the host (not the container). Let's fix that. While we are there, let's improve the explanation too. Signed-off-by: Rodrigo Campos (cherry picked from commit b327397)
1 parent 99a1995 commit a0f6d32

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

content/en/docs/tasks/configure-pod-container/user-namespaces.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,42 @@ to `false`. For example:
8282
kubectl attach -it userns bash
8383
```
8484

85-
And run the command. The output is similar to this:
85+
Run this command:
8686

87-
```none
87+
```shell
8888
readlink /proc/self/ns/user
89+
```
90+
91+
The output is similar to:
92+
93+
```shell
8994
user:[4026531837]
95+
```
96+
97+
Also run:
98+
99+
```shell
90100
cat /proc/self/uid_map
91-
0 0 4294967295
92101
```
93102

94-
Then, open a shell in the host and run the same command.
103+
The output is similar to:
104+
```shell
105+
0 833617920 65536
106+
```
107+
108+
Then, open a shell in the host and run the same commands.
109+
110+
The `readlink` command shows the user namespace the process is running in. It
111+
should be different when it is run on the host and inside the container.
95112

96-
The output must be different. This means the host and the pod are using a
97-
different user namespace. When user namespaces are not enabled, the host and the
98-
pod use the same user namespace.
113+
The last number of the `uid_map` file inside the container must be 65536, on the
114+
host it must be a bigger number.
99115

100116
If you are running the kubelet inside a user namespace, you need to compare the
101117
output from running the command in the pod to the output of running in the host:
102118

103-
```none
119+
```shell
104120
readlink /proc/$pid/ns/user
105-
user:[4026534732]
106121
```
107122

108123
replacing `$pid` with the kubelet PID.

0 commit comments

Comments
 (0)