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