0
0
Kubernetesdevops~5 mins

Roles and ClusterRoles in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Role in Kubernetes?
A Role defines permissions within a specific namespace. It controls what actions a user or service can perform on resources inside that namespace.
Click to reveal answer
beginner
What is a ClusterRole in Kubernetes?
A ClusterRole defines permissions across the entire cluster or can be used in any namespace. It controls actions on cluster-wide resources or multiple namespaces.
Click to reveal answer
intermediate
How does a Role differ from a ClusterRole?
A Role is limited to one namespace, while a ClusterRole applies cluster-wide or to multiple namespaces. ClusterRoles can also grant access to cluster-scoped resources.
Click to reveal answer
intermediate
What is the purpose of RoleBinding and ClusterRoleBinding?
RoleBinding assigns a Role to users or groups within a namespace. ClusterRoleBinding assigns a ClusterRole to users or groups cluster-wide or across namespaces.
Click to reveal answer
intermediate
Can a ClusterRole be used in a single namespace?
Yes, a ClusterRole can be bound to a user or group in a specific namespace using a RoleBinding, allowing cluster-wide permissions to be applied locally.
Click to reveal answer
What scope does a Kubernetes Role apply to?
AThe entire cluster
BA single namespace
CMultiple clusters
DOnly system namespaces
Which Kubernetes object grants cluster-wide permissions?
ARole
BNamespace
CRoleBinding
DClusterRole
How do you assign a ClusterRole to a user in a specific namespace?
AUsing ClusterRoleBinding
BUsing NamespaceBinding
CUsing RoleBinding
DUsing PodSecurityPolicy
Which object is used to bind a Role to a user?
ARoleBinding
BClusterRoleBinding
CServiceAccount
DPod
Can a Role grant permissions on cluster-scoped resources?
ANo, Roles are namespace-scoped
BYes, always
COnly if combined with ClusterRole
DOnly in system namespaces
Explain the difference between a Role and a ClusterRole in Kubernetes.
Think about where each permission applies.
You got /4 concepts.
    Describe how RoleBinding and ClusterRoleBinding are used to assign permissions.
    Focus on how permissions are linked to users.
    You got /4 concepts.