Skip to content

Fix: Ensure resource names in ClusterRole are plural and lowercase #50370

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/en/docs/reference/access-authn-authz/rbac.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ rules:
The following examples are excerpts from Role or ClusterRole objects, showing only
the `rules` section.

Note: When specifying resources in a ClusterRole or Role, always use the plural and lowercase form of the resource name.
For example, use pods instead of pod, services instead of service.
Incorrect resource names will cause RBAC policies to fail.
Comment on lines +345 to +347
Copy link
Member

Choose a reason for hiding this comment

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

The important part is that it match the REST API URL, which for built-in types is always plural and lowercase, but might not be for aggregated API servers.

Suggested change
Note: When specifying resources in a ClusterRole or Role, always use the plural and lowercase form of the resource name.
For example, use pods instead of pod, services instead of service.
Incorrect resource names will cause RBAC policies to fail.
Note: When specifying resources in a ClusterRole or Role, always use the resource exactly as it appears in the REST API path segment.
For example, use `pods` instead of `pod` or `Pods`.
Resources that do not exactly match the REST API path segment will not authorize the request.


Allow reading `"pods"` resources in the core
{{< glossary_tooltip text="API Group" term_id="api-group" >}}:

Expand Down