Certified Kubernetes Application Developer (CKAD) Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Enhance your skills for the CKAD exam. Study with curated quizzes and detailed explanations. Prepare effectively for your success!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


How can you create a service account in Kubernetes?

  1. kubectl create serviceaccount <name>

  2. kubectl new serviceaccount <name>

  3. kubectl add serviceaccount <name>

  4. kubectl initiate serviceaccount <name>

The correct answer is: kubectl create serviceaccount <name>

Creating a service account in Kubernetes is accomplished using the command `kubectl create serviceaccount <name>`. This command directly instructs Kubernetes to create a new service account in the specified namespace (if a namespace is not specified, it defaults to the 'default' namespace). Service accounts are important in Kubernetes as they provide an identity for processes that run in a pod, allowing them to interact with the Kubernetes API. The `create serviceaccount` command is a standard way to accomplish this task, following the expected syntax for creating resources within Kubernetes. The other options presented do not correspond to valid commands in Kubernetes. For instance, "new", "add", and "initiate" are not recognized verbs in the context of managing Kubernetes resources, hence they would lead to errors if attempted. The command structure in Kubernetes is fairly consistent, with "create" being the correct verb for initiating the creation of resources like service accounts.