CKA Storage Practice Question
A cluster administrator needs to provide storage to a pod that must read and write files, but the data does not need to persist beyond the pod's lifecycle. Which volume type should be used?
⚠ Common exam trap
Watch out — candidates often confuse emptyDir with hostPath, thinking both provide temporary storage, but hostPath persists on the node and can cause data leakage or node-specific issues, while emptyDir is truly ephemeral and tied to the pod's lifecycle.
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
✓
emptyDir
B is correct because emptyDir creates an empty volume that is provisioned when a pod is assigned to a node and exists as long as the pod is running. It allows both reading and writing files, and its contents are deleted when the pod is removed, matching the requirement that data does not need to persist beyond the pod's lifecycle.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
hostPath
Why it's wrong here
While a hostPath volume mounts a file or directory from the host node's filesystem directly into your Pod, it persists independently of the Pod's lifecycle. If the Pod is deleted or rescheduled to another node, the data remains on the original host, which violates the requirement for temporary, Pod-lifecycle-bound storage. Additionally, using hostPath introduces security risks and couples the Pod to a specific node's filesystem structure.
- ✓
emptyDir
Why this is correct
An emptyDir volume is created when a Pod is assigned to a node and exists solely for the lifetime of that Pod on that node. It provides a clean, read-write directory that is automatically deleted when the Pod terminates, making it the ideal choice for transient scratch space, multi-container sharing, or caching. Since the data does not need to survive Pod deletion, this lightweight, ephemeral storage mechanism perfectly satisfies the requirements.
- ✗
configMap
Why it's wrong here
A configMap is designed to inject non-confidential configuration data, such as environment variables or read-only configuration files, into a container. It is mounted as a read-only volume by default and cannot be used as a general-purpose read-write storage medium for application data or temporary scratch space. Attempting to write to a mounted ConfigMap volume will result in a read-only filesystem error.
- ✗
PersistentVolumeClaim
Why it's wrong here
A PersistentVolumeClaim (PVC) is used to request durable, long-term storage backed by a PersistentVolume (PV) that exists independently of any Pod's lifecycle. If a Pod utilizing a PVC is deleted, the underlying volume and its data persist according to the PV's reclaim policy (such as Retain or Delete). This introduces unnecessary overhead and resource allocation for temporary storage needs that should be bound strictly to the Pod's execution span.
Go deeper
Related to this question
About these practice questions
This CKA question is part of Courseiva's 726-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 CKA 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 CKA exam.