liveBook · Manning

Role

As explained in Kubernetes for Developers

A Kubernetes Role is a namespace-scoped object that defines permissions for API groups, resources, and verbs.

A Kubernetes Role defines what a user may do inside one namespace. It grants permissions by combining API groups, resources, and verbs, such as allowing all operations on Pods, Services, or Deployments in the team1 namespace. Permissions are additive: a Role grants everything listed and cannot subtract access. section 12.6

Use a Role with a RoleBinding to give a developer controlled deployment access:

  • Bind the Role to a user or other subject with RoleBinding. section 12.6
  • Use ClusterRole and ClusterRoleBinding instead when permissions must cover cluster-scoped resources. section 12.6

How Kubernetes for Developers covers it

How deep it goes
Explains namespace scope, permission rules, bindings, and cluster-level counterparts through deployable YAML and command results.
Examples
Uses a team1 developer Role, user binding, deployment attempts, and forbidden namespace and cluster-resource operations.
What it assumes
Assumes users, namespaces, API resources, and kubectl while explaining RBAC objects and permission structure.
What you can do after
Operate/configure namespace permissions with Role YAML, RoleBinding, and kubectl.
How it connects
Connects Role to RBAC, RoleBinding, ClusterRole, ClusterRoleBinding, namespaces, and Pod Security admission.

Also explained in

Compare how 11 books explain role →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.