Which command grants the system:image-puller role to system:serviceaccount:myphp in the otherphp namespace?

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

Which command grants the system:image-puller role to system:serviceaccount:myphp in the otherphp namespace?

Explanation:
Granting a role to a service account lets that service account perform actions in a namespace, such as pulling images. In OpenShift, the service account is treated as a user identity, so you attach the image-puller capability to the service account's identity and scope it to the namespace where the service account runs. The correct approach uses a policy command to bind the system:image-puller role to the service account identity, identified as system:serviceaccount:<namespace>:<name>, and you specify the target namespace with -n to create the binding in that namespace. This ensures pods using that service account in otherphp can pull images from the image registry. Other options either try to create a binding inappropriately, reference the wrong namespace, or remove a binding, which would not grant the needed permissions.

Granting a role to a service account lets that service account perform actions in a namespace, such as pulling images. In OpenShift, the service account is treated as a user identity, so you attach the image-puller capability to the service account's identity and scope it to the namespace where the service account runs. The correct approach uses a policy command to bind the system:image-puller role to the service account identity, identified as system:serviceaccount::, and you specify the target namespace with -n to create the binding in that namespace. This ensures pods using that service account in otherphp can pull images from the image registry.

Other options either try to create a binding inappropriately, reference the wrong namespace, or remove a binding, which would not grant the needed permissions.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy