Skip to content

Commit dc326f0

Browse files
chirangaalwissejr
andcommitted
Add example for querying SA permissions
Add example for querying SA permissions Add missing example for querying the API authorization layer for checking the permissions of a Service Account Add missing SA identifying prefix Improve suggested text to align with current content Co-authored-by: Sam Roth <[email protected]> Improve suggested text to align with current content Co-authored-by: Sam Roth <[email protected]>
1 parent b7a6f0e commit dc326f0

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)