From 16789369670d9db01e97046faa78f7f0f6a1083f Mon Sep 17 00:00:00 2001 From: makocchi Date: Sat, 21 Jul 2018 08:04:57 +0900 Subject: [PATCH] remove command prompts and tweak shell commands (#9597) --- .../configure-service-account.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/content/en/docs/tasks/configure-pod-container/configure-service-account.md b/content/en/docs/tasks/configure-pod-container/configure-service-account.md index 204c1bf1ee..23fc4cf777 100644 --- a/content/en/docs/tasks/configure-pod-container/configure-service-account.md +++ b/content/en/docs/tasks/configure-pod-container/configure-service-account.md @@ -85,7 +85,7 @@ Every namespace has a default service account resource called `default`. You can list this and any other serviceAccount resources in the namespace with this command: ```shell -$ kubectl get serviceAccounts +kubectl get serviceAccounts NAME SECRETS AGE default 1 1d ``` @@ -93,20 +93,19 @@ default 1 1d You can create additional ServiceAccount objects like this: ```shell -$ cat > /tmp/serviceaccount.yaml < /tmp/build-robot-secret.yaml < @@ -187,7 +185,7 @@ First, create an imagePullSecret, as described [here](/docs/concepts/containers/ Next, verify it has been created. For example: ```shell -$ kubectl get secrets myregistrykey +kubectl get secrets myregistrykey NAME TYPE DATA AGE myregistrykey   kubernetes.io/.dockerconfigjson   1       1d ``` @@ -201,8 +199,9 @@ kubectl patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"my Interactive version requiring manual edit: ```shell -$ kubectl get serviceaccounts default -o yaml > ./sa.yaml -$ cat sa.yaml +kubectl get serviceaccounts default -o yaml > ./sa.yaml + +cat sa.yaml apiVersion: v1 kind: ServiceAccount metadata: @@ -214,11 +213,13 @@ metadata: uid: 052fb0f4-3d50-11e5-b066-42010af0d7b6 secrets: - name: default-token-uudge -$ vi sa.yaml + +vi sa.yaml [editor session not shown] [delete line with key "resourceVersion"] [add lines with "imagePullSecrets:"] -$ cat sa.yaml + +cat sa.yaml apiVersion: v1 kind: ServiceAccount metadata: @@ -231,7 +232,8 @@ secrets: - name: default-token-uudge imagePullSecrets: - name: myregistrykey -$ kubectl replace serviceaccount default -f ./sa.yaml + +kubectl replace serviceaccount default -f ./sa.yaml serviceaccounts/default ```