Courseiva

CKAD Practice Question: Application Environment, Configuration and Security

To mount a ConfigMap as a volume, which field type must be used in the pod spec's volumes and volumeMounts?

⚠ Common exam trap

Test-takers frequently confuse `configMap` with `secret` because both are used to inject configuration data, but the question specifically asks for the field type to mount a ConfigMap, not a Secret.

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

✓

configMap

To mount a ConfigMap as a volume in a Pod, the `configMap` field type must be specified in the `volumes` array of the Pod spec, and the corresponding `volumeMounts` entry references that volume by name. This tells Kubernetes to populate the volume with the key-value pairs from the ConfigMap, making them available 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.

  • ✓

    configMap

    Why this is correct

    The configMap volume type is the only correct choice because it directly references a ConfigMap object in the volumes field of a pod spec. When this type is used, the kubelet retrieves the ConfigMap's key-value data and materializes it as files in the volume, making the configuration accessible to containers via mountPath. You can further control the projection with items for selecting specific keys and defaultMode for file permissions.

  • ✗

    emptyDir

    Why it's wrong here

    An emptyDir volume is a transient directory created on the node when a pod is assigned, and it is completely emptied when the pod is deleted. It serves as scratch space for same-pod containers to share data and is not populated from any Kubernetes API object like a ConfigMap. Mounting a ConfigMap into an emptyDir would require external scripts copying data, which is neither automatic nor supported by the volume type itself.

  • ✗

    secret

    Why it's wrong here

    The secret volume type is purpose-built for Secret objects, not ConfigMaps, although its mechanics are nearly identical. Secret data is base64-encoded when stored in etcd and is meant for confidential information such as passwords or API keys, whereas a ConfigMap holds non-sensitive configuration. Even though you could theoretically store the same data in a Secret, the question explicitly demands a ConfigMap, so this field type would not reference that ConfigMap.

  • ✗

    hostPath

    Why it's wrong here

    A hostPath volume mounts a specific file or directory from the node's filesystem directly into the pod, bypassing any Kubernetes API object. This is typically used for node-level tools or persistent local storage, and it lacks any built-in understanding of ConfigMaps. To get ConfigMap contents into a container, you must use the configMap volume type, which retrieves the data from etcd via the API server and projects it as files.

About these practice questions

This CKAD question is part of Courseiva's 826-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 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.