From 5d83dcbf46efecef6d3e9f5222011683946c7cfb Mon Sep 17 00:00:00 2001 From: Ricardo Cordeiro Date: Wed, 10 Apr 2019 02:56:12 +0100 Subject: [PATCH] Fixes `runAsGroup` security context example (#13535) (#13538) --- .../tasks/configure-pod-container/security-context.md | 8 ++++---- content/en/examples/pods/security/security-context.yaml | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/content/en/docs/tasks/configure-pod-container/security-context.md b/content/en/docs/tasks/configure-pod-container/security-context.md index 39dbc60927..9e690fd66a 100644 --- a/content/en/docs/tasks/configure-pod-container/security-context.md +++ b/content/en/docs/tasks/configure-pod-container/security-context.md @@ -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 ... ``` diff --git a/content/en/examples/pods/security/security-context.yaml b/content/en/examples/pods/security/security-context.yaml index 86ca51d39a..35cb1eeebe 100644 --- a/content/en/examples/pods/security/security-context.yaml +++ b/content/en/examples/pods/security/security-context.yaml @@ -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