Skip to content

Commit 2826614

Browse files
authored
Merge pull request #30008 from chirangaalwis/patch-2
Add missing example for querying permissions of a Service Account
2 parents 381dfa3 + dc326f0 commit 2826614

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

content/en/docs/reference/access-authn-authz/authorization.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@ The output is similar to this:
134134
no
135135
```
136136

137+
Similarly, to check whether a Service Account named `dev-sa` in Namespace `dev`
138+
can list Pods in the Namespace `target`:
139+
140+
```bash
141+
kubectl auth can-i list pods \
142+
--namespace target \
143+
--as system:serviceaccount:dev:dev-sa
144+
```
145+
146+
The output is similar to this:
147+
148+
```
149+
yes
150+
```
151+
137152
`SelfSubjectAccessReview` is part of the `authorization.k8s.io` API group, which
138153
exposes the API server authorization to external services. Other resources in
139154
this group include:

0 commit comments

Comments
 (0)