Fixes runAsGroup security context example (#13535) (#13538)

This commit is contained in:
Ricardo Cordeiro
2019-04-10 02:56:12 +01:00
committed by Kubernetes Prow Robot
parent a80483bb52
commit 5d83dcbf46
2 changed files with 7 additions and 5 deletions
@@ -79,15 +79,15 @@ kubectl exec -it security-context-demo -- sh
In your shell, list the running processes:
```shell
ps aux
ps
```
The output shows that the processes are running as user 1000, which is the value of `runAsUser`:
```shell
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
1000 1 0.0 0.0 4336 724 ? Ss 18:16 0:00 /bin/sh -c node server.js
1000 5 0.2 0.6 772124 22768 ? Sl 18:16 0:00 node server.js
PID USER TIME COMMAND
1 1000 0:00 sleep 1h
6 1000 0:00 sh
...
```
@@ -5,13 +5,15 @@ metadata:
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
volumes:
- name: sec-ctx-vol
emptyDir: {}
containers:
- name: sec-ctx-demo
image: gcr.io/google-samples/node-hello:1.0
image: busybox
command: [ "sh", "-c", "sleep 1h" ]
volumeMounts:
- name: sec-ctx-vol
mountPath: /data/demo