In RBAC, which resources are most appropriate to grant namespace-scoped permissions to create pods?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

In RBAC, which resources are most appropriate to grant namespace-scoped permissions to create pods?

Explanation:
The important idea here is using namespace-scoped RBAC to control who can perform actions in a specific namespace. A Role is defined within a single namespace and lists the allowed actions (verbs) on particular resources; a RoleBinding then ties that Role to a subject (user, group, or service account) within the same namespace. To allow creating pods in a given namespace, you define a Role with a rule for the pods resource and the create verb, and you bind that Role to the desired subject via a RoleBinding in that namespace. Using a ClusterRole and ClusterRoleBinding would grant permissions cluster-wide, not limited to one namespace, which misses the namespace-scoped requirement. SecurityContextConstraints don’t grant create permissions, they govern pod security settings. A ServiceAccount without any bindings has no permissions to perform actions.

The important idea here is using namespace-scoped RBAC to control who can perform actions in a specific namespace. A Role is defined within a single namespace and lists the allowed actions (verbs) on particular resources; a RoleBinding then ties that Role to a subject (user, group, or service account) within the same namespace. To allow creating pods in a given namespace, you define a Role with a rule for the pods resource and the create verb, and you bind that Role to the desired subject via a RoleBinding in that namespace.

Using a ClusterRole and ClusterRoleBinding would grant permissions cluster-wide, not limited to one namespace, which misses the namespace-scoped requirement. SecurityContextConstraints don’t grant create permissions, they govern pod security settings. A ServiceAccount without any bindings has no permissions to perform actions.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy