Role
A namespaced RBAC object listing which verbs are allowed on which resources inside one namespace.
In more detail
A Role grants nothing until a RoleBinding attaches it to a subject. Prefer namespaced Roles for namespaced work and keep the verbs and resources as narrow as the job allows.
Examples
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]rules: [{apiGroups: [""], resources: ["pods"], verbs: ["get", "list"]}]Related terms
- RoleBinding — The RBAC object that grants the permissions of a Role or ClusterRole to subjects within one namespace.
- ClusterRole — An RBAC object like a Role but not tied to a namespace, used for cluster-wide resources or as a set of rules shared by many namespaces.
- role-based access control — An authorization model where permissions are grouped into named roles, such as reader or editor, and people or services are given roles.
- API verb — The action an API request performs, such as get, list, watch, create, update, patch or delete, which RBAC rules allow one by one.
- Kubernetes namespace — A named area inside a cluster that keeps object names apart and groups them for permissions, quotas and policies.
Taught in
- Spend Two Hours Like A Points Table — Certified Kubernetes Administrator (CKA) Exam Prep
- Generators Write The YAML, You Decide — Certified Kubernetes Administrator (CKA) Exam Prep
- Four Faults, Twelve Minutes — Certified Kubernetes Administrator (CKA) Exam Prep
- RBAC: From Everything To Exactly Enough — Certified Kubernetes Administrator (CKA) Exam Prep
- Gateway API: A Route Asks, A Gateway Allows — Certified Kubernetes Administrator (CKA) Exam Prep
- Mock Exam: Seventeen Tasks Against The Clock — Certified Kubernetes Administrator (CKA) Exam Prep
- ServiceAccounts And Tokens — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Authentication, Authorisation And Admission — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Configuration And Security: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Mock Exam: Sixteen Tasks Against The Clock — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Gateway API: GatewayClass, Gateway And HTTPRoute — Kubernetes: Production-Grade Container Orchestration
- Node Affinity, Pod Affinity And Topology Spread — Kubernetes: Production-Grade Container Orchestration
- Authentication, ServiceAccounts And Short Lived Tokens — Kubernetes: Production-Grade Container Orchestration
- RBAC: Roles, Bindings And Least Privilege — Kubernetes: Production-Grade Container Orchestration
- Drain, Upgrade, Version Skew And Certificate Maintenance — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: NotReady Nodes And kubelet Logs — Kubernetes: Production-Grade Container Orchestration
- Least Privilege In IAM And RBAC — Application Security & Threat Modeling for Engineers