Merge pull request #25982 from ydFu/add-code-blocks-in-authorization
Add the code blocks in authorization.md
This commit is contained in:
commit
c782fd6738
|
|
@ -104,6 +104,9 @@ a given action, and works regardless of the authorization mode used.
|
||||||
```bash
|
```bash
|
||||||
kubectl auth can-i create deployments --namespace dev
|
kubectl auth can-i create deployments --namespace dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The output is similar to this:
|
||||||
|
|
||||||
```
|
```
|
||||||
yes
|
yes
|
||||||
```
|
```
|
||||||
|
|
@ -111,6 +114,9 @@ yes
|
||||||
```shell
|
```shell
|
||||||
kubectl auth can-i create deployments --namespace prod
|
kubectl auth can-i create deployments --namespace prod
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The output is similar to this:
|
||||||
|
|
||||||
```
|
```
|
||||||
no
|
no
|
||||||
```
|
```
|
||||||
|
|
@ -121,6 +127,9 @@ to determine what action other users can perform.
|
||||||
```bash
|
```bash
|
||||||
kubectl auth can-i list secrets --namespace dev --as dave
|
kubectl auth can-i list secrets --namespace dev --as dave
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The output is similar to this:
|
||||||
|
|
||||||
```
|
```
|
||||||
no
|
no
|
||||||
```
|
```
|
||||||
|
|
@ -150,7 +159,7 @@ EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
The generated `SelfSubjectAccessReview` is:
|
The generated `SelfSubjectAccessReview` is:
|
||||||
```
|
```yaml
|
||||||
apiVersion: authorization.k8s.io/v1
|
apiVersion: authorization.k8s.io/v1
|
||||||
kind: SelfSubjectAccessReview
|
kind: SelfSubjectAccessReview
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue