提交 15c46a25 编写于 作者: M Michael Tran 提交者: Kubernetes Prow Robot

Update creating-sample-user.md (#4659)

Added PowerShell equivalent so it's clear for Windows how to create the sample user.

Clarified the statement to running the snippets. When I first read the statement, and tried it out, I was confused why it wasn't working. Turns out it's because I copied BOTH snippets to a single yaml file and running that...
You have to copy it to separate yaml files and executing them separately to work.
上级 5c51d024
......@@ -4,7 +4,7 @@ In this guide, we will find out how to create a new user using Service Account m
**IMPORTANT:** Make sure that you know what you are doing before proceeding. Granting admin privileges to Dashboard's Service Account might be a security risk.
Copy following snippets for `ServiceAccount` and `ClusterRoleBinding` to new manifest file like `dashboard-adminuser.yaml` and use `kubectl apply -f dashboard-adminuser.yaml` to create them.
For each of the following snippets for `ServiceAccount` and `ClusterRoleBinding`, you should copy them to new manifest files like `dashboard-adminuser.yaml` and use `kubectl apply -f dashboard-adminuser.yaml` to create them.
## Create Service Account
......@@ -43,10 +43,17 @@ subjects:
Now we need to find token we can use to log in. Execute following command:
```
For Bash:
```bash
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
```
For Powershell:
```powershell
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | sls admin-user | ForEach-Object { $_ -Split '\s+' } | Select -First 1)
```
It should print something like:
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册