Courseiva
StorageeasyMultiple ChoiceObjective-mapped

CKA Storage Practice Question

Which volume type in Kubernetes allows a Pod to share data between its containers, with the data being deleted when the Pod is removed?

⚠ Common exam trap

Test-takers frequently confuse emptyDir with hostPath, thinking hostPath also provides ephemeral storage, but hostPath data persists on the node even after the Pod is deleted, which violates the requirement of data deletion upon Pod removal.

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

The emptyDir volume type is created when a Pod is assigned to a node and exists as long as the Pod is running. It provides a shared writable directory for all containers within the same Pod, and its contents are deleted when the Pod is removed from the node. This makes it the correct choice for ephemeral data sharing between containers.

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

    The hostPath volume mounts a file or directory directly from the underlying node's filesystem into the pod. While it can facilitate data access, it creates a dependency on the specific node and is primarily used for host-level access or system-specific configurations, not for transient, portable data sharing between containers within a pod. Its data persists even if the pod is deleted, which is contrary to the ephemeral nature implied by 'sharing data between containers' for a single pod's runtime.

  • emptyDir

    Why this is correct

    emptyDir is created when the Pod is assigned to a node and exists as long as that Pod is running. It is used for sharing data between containers and is deleted when the Pod is removed.

  • configMap

    Why it's wrong here

    A ConfigMap is designed to inject non-sensitive configuration data into pods, typically as environment variables or files. It provides static, read-only configuration values that are defined externally to the pod, making it unsuitable for dynamic, temporary data generated and shared by containers during their execution. Its purpose is configuration, not transient inter-container data exchange.

  • secret

    Why it's wrong here

    Similar to ConfigMaps, Secrets are used to inject sensitive data, such as passwords or API tokens, into pods, often mounted as files or exposed as environment variables. They provide static, pre-defined sensitive information and are not intended for dynamic, temporary data sharing between containers that generate and consume data during their lifecycle. Using Secrets for transient data sharing would also be a security anti-pattern.

About these practice questions

This CKA question is part of Courseiva's 302-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 →

How Courseiva writes practice questions · Editorial policy

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.