CKAD Practice Question: Application Environment, Configuration and Security
You have created a ServiceAccount named 'my-sa' in namespace 'default'. You want a Pod to use this ServiceAccount. Which Pod spec field is correct?
⚠ Common exam trap
Many exam-takers confuse the deprecated `serviceAccount` field with the current `serviceAccountName` field, or incorrectly assume that `securityContext` can set the ServiceAccount.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
serviceAccountName: my-sa
The `serviceAccountName` field in a Pod spec is the standard way to assign a specific ServiceAccount to a Pod. When this field is set to `my-sa`, the Pod will use the token and permissions associated with that ServiceAccount for API authentication and authorization.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
spec.securityContext.serviceAccount: my-sa
Why it's wrong here
The securityContext field configures security-related settings such as Linux capabilities, user and group IDs, or SELinux options, and it does not contain a serviceAccount subfield. A ServiceAccount is referenced at the pod level using serviceAccountName, not nested inside securityContext, so this invalid configuration would be rejected by the API server.
- ✓
serviceAccountName: my-sa
Why this is correct
The serviceAccountName field is the correct way to assign the ServiceAccount my-sa to the pod. It is a top-level field in the pod spec, and when set, all containers in the pod share the identity and permissions of that ServiceAccount. Omitting it defaults to the 'default' ServiceAccount in the namespace.
- ✗
serviceAccount: my-sa
Why it's wrong here
The 'serviceAccount' field is a deprecated legacy alias that was historically used in early Kubernetes versions but has been replaced by 'serviceAccountName'. While the API server may still accept it for backward compatibility, it is not the recommended field, and depending on the version, it may generate a warning or be ignored in favor of serviceAccountName. Use the explicit current field name to configure the ServiceAccount correctly.
- ✗
automountServiceAccountToken: false
Why it's wrong here
This field controls whether the ServiceAccount token is automatically mounted into the container's filesystem, independent of which ServiceAccount is selected. Setting it to false does not specify a ServiceAccount; it simply prevents the default token from being mounted. To use my-sa, you still need to set serviceAccountName, and this option would only be used to disable the token mount if desired.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.