Which statement about Roles and ClusterRoles is true?

Study for the Kubernetes Cloud Native Associate (KCNA) Certification. Prepare with flashcards and multiple choice questions. Ensure success with detailed explanations. Ready for your exam!

Multiple Choice

Which statement about Roles and ClusterRoles is true?

Explanation:
In Kubernetes RBAC, scope matters: Roles are defined per namespace, while ClusterRoles are defined cluster-wide. That means a Role controls permissions only inside its specific namespace, whereas a ClusterRole can grant access to resources across the entire cluster (including multiple namespaces and cluster-scoped resources). To apply these roles, you use RoleBinding to attach a Role to a subject within a namespace, or use ClusterRoleBinding to attach a ClusterRole to a subject across the whole cluster. You can also bind a ClusterRole in a single namespace by using a RoleBinding that references the ClusterRole, allowing the same set of permissions to be reused in many namespaces. So the statement that ClusterRoles are used for cluster-wide permissions and Roles for namespace-level permissions is correct. The other options are off because roles are not limited to pod-level access, cluster roles can be bound to users (via ClusterRoleBinding or by binding ClusterRoles in a namespace), and Role cannot grant cluster-wide permissions by itself.

In Kubernetes RBAC, scope matters: Roles are defined per namespace, while ClusterRoles are defined cluster-wide. That means a Role controls permissions only inside its specific namespace, whereas a ClusterRole can grant access to resources across the entire cluster (including multiple namespaces and cluster-scoped resources). To apply these roles, you use RoleBinding to attach a Role to a subject within a namespace, or use ClusterRoleBinding to attach a ClusterRole to a subject across the whole cluster. You can also bind a ClusterRole in a single namespace by using a RoleBinding that references the ClusterRole, allowing the same set of permissions to be reused in many namespaces.

So the statement that ClusterRoles are used for cluster-wide permissions and Roles for namespace-level permissions is correct. The other options are off because roles are not limited to pod-level access, cluster roles can be bound to users (via ClusterRoleBinding or by binding ClusterRoles in a namespace), and Role cannot grant cluster-wide permissions by itself.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy