Skip to content

kubectl-auth: add page #17207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

esteramine
Copy link

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page(s) have at most 8 examples.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented (if known):

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers. labels Jul 11, 2025
Copy link
Member

@MachiavelliII MachiavelliII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, and welcome to tldr.

Comment on lines +8 to +20
`kubectl auth can-i '*' '*' -n {{namespace}}`

- Check if the current user can perform a specific verb on a specific resource:

`kubectl auth can-i {{verb}} {{resource}} -n {{namespace}}`

- Check if a specific user or service account can perform an action on a resource:

`kubectl auth can-i {{verb}} {{resource}} -n {{namespace}} --as {{user_or_sa}}`

- List all actions the current user is allowed to perform in a namespace:

`kubectl auth can-i --list -n {{namespace}}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`kubectl auth can-i '*' '*' -n {{namespace}}`
- Check if the current user can perform a specific verb on a specific resource:
`kubectl auth can-i {{verb}} {{resource}} -n {{namespace}}`
- Check if a specific user or service account can perform an action on a resource:
`kubectl auth can-i {{verb}} {{resource}} -n {{namespace}} --as {{user_or_sa}}`
- List all actions the current user is allowed to perform in a namespace:
`kubectl auth can-i --list -n {{namespace}}`
`kubectl auth can-i '*' '*' {{[-n|--namespace]}} {{namespace}}`
- Check if the current user can perform a specific verb on a specific resource:
`kubectl auth can-i {{verb}} {{resource}} {{[-n|--namespace]}} {{namespace}}`
- Check if a specific user or service account can perform an action on a resource:
`kubectl auth can-i {{verb}} {{resource}} {{[-n|--namespace]}} {{namespace}} --as {{user_or_sa}}`
- List all actions the current user is allowed to perform in a namespace:
`kubectl auth can-i --list {{[-n|--namespace]}} {{namespace}}`

Either use long options by themselves or use option placeholders like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants