CKAD Practice Question: Application Environment, Configuration and Security
Which of the following YAML fields can be used to mount a Secret as a volume in a Pod?
⚠ Common exam trap
Many exam-takers confuse `envFrom` (which injects Secret data as environment variables) with volume mounting, or they mistakenly think `imagePullSecrets` or `annotations` can serve as volume sources, when in fact only the `volumes` field supports the `secret` volume type.
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
✓
volumes
The `volumes` field in a Pod spec allows you to define a volume of type `secret`, which can then be mounted into a container using the `volumeMounts` field. This is the standard Kubernetes mechanism for exposing Secret data as files in the container's filesystem.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
volumes
Why this is correct
The `volumes` field in a Pod's spec is the correct place to define a volume that uses a Secret as its source (e.g., `secret.secretName`). Once defined, the same volume is mounted into a specific container using `volumeMounts` at the desired path, allowing the Secret's keys to appear as files. This is the standard Kubernetes mechanism for mounting a Secret as a volume.
- ✗
imagePullSecrets
Why it's wrong here
The `imagePullSecrets` field in a Pod's spec is used exclusively to supply registry credentials (e.g., a dockerconfigjson Secret) when pulling container images from private registries. It does not create, attach, or expose any Secret data inside the container filesystem, so it cannot be used to mount a Secret as a volume.
- ✗
annotations
Why it's wrong here
The `annotations` field is a metadata mechanism for attaching arbitrary non-identifying key-value pairs to a Kubernetes object, such as a Pod or Deployment. It is not a runtime configuration field and does not influence container execution, persistence, or volume behavior; thus it has no role in mounting Secrets.
- ✗
envFrom
Why it's wrong here
The `envFrom` field, when specified in a container definition, reads all keys from a Secret or ConfigMap and injects them as environment variables into that container. This is an alternative to volume mounting and does not create any filesystem paths; therefore it cannot be used to mount a Secret as a volume.
Go deeper
Related to this question
About these practice questions
One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.