|
162 | 162 |
|
163 | 163 | ### Implicit group memberships defined in `/etc/group` in the container image
|
164 | 164 |
|
165 |
| -By default, kubernetes merges group information for the container's primary user defined in |
166 |
| -`/etc/group` in the container image. |
| 165 | +By default, kubernetes merges group information from the Pod with information defined in `/etc/group` in the container image. |
167 | 166 |
|
168 | 167 | {{% code_sample file="pods/security/security-context-5.yaml" %}}
|
169 | 168 |
|
@@ -198,22 +197,22 @@ $ id
|
198 | 197 | The output is similar to this:
|
199 | 198 |
|
200 | 199 | ```none
|
201 |
| -uid=1000(user-defined-in-image) gid=3000 groups=3000,4000,50000(group-defined-in-image) |
| 200 | +uid=1000 gid=3000 groups=3000,4000,50000 |
202 | 201 | ```
|
203 | 202 |
|
204 |
| -You can see `groups` includes group ID `50000`. This is because the user (`uid=1000(user-defined-in-image)`) |
205 |
| -belongs to the group `group-defined-in-image(gid=50000)` which is defined in `/etc/group` in the container image. |
| 203 | +You can see `groups` includes group ID `50000`. This is because the user (`uid=1000`), which is defined in the image, belongs to the group (`gid=50000`), which is defined in `/etc/group` inside the container image. |
206 | 204 |
|
207 | 205 | Check the `/etc/group` in the container image:
|
208 | 206 |
|
209 | 207 | ```shell
|
210 | 208 | $ cat /etc/group
|
211 | 209 | ```
|
212 | 210 |
|
213 |
| -You can see the group entry that `user-defined-in-image(uid=1000)` belongs to `group-defined-in-image(gid=50000)`. |
| 211 | +You can see that uid `1000` belongs to group `50000`. |
214 | 212 |
|
215 | 213 | ```none
|
216 | 214 | ...
|
| 215 | +user-defined-in-image:x:1000: |
217 | 216 | group-defined-in-image:x:50000:user-defined-in-image
|
218 | 217 | ```
|
219 | 218 |
|
@@ -272,7 +271,7 @@ kubectl exec -it security-context-demo -- id
|
272 | 271 | The output is similar to this:
|
273 | 272 |
|
274 | 273 | ```none
|
275 |
| -uid=1000(user-defined-in-image) gid=3000 groups=3000,4000 |
| 274 | +uid=1000 gid=3000 groups=3000,4000 |
276 | 275 | ```
|
277 | 276 |
|
278 | 277 | See the Pod's status:
|
|
0 commit comments