Which command would you run to create a service account in a specific namespace?

Prepare for the Certified Kubernetes Administrator Exam with our in-depth quiz. Access flashcards and multiple-choice questions, each accompanied by hints and explanations. Ace your Kubernetes exam!

To create a service account in a specific namespace, the command to use is kubectl create serviceaccount. This command is part of the kubectl command-line tool that interacts with Kubernetes clusters.

When you use this command, you typically specify the name of the service account you want to create. Additionally, if you want this service account to exist in a specific namespace, you can include the -n or --namespace flag followed by the namespace name.

This command directly references the Kubernetes API to create the service account resource, making it a straightforward and efficient way to manage service accounts within your cluster.

The other options do not correspond to valid kubectl commands for creating service accounts. For instance, "new," "deploy," and "add" are not recognized subcommands in the context of service account management. Hence, the first command is the only one that accurately aligns with Kubernetes operations for creating a service account.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy