CKA Workloads and Scheduling Practice Question
You want to mount a Secret named 'db-secret' as a volume in a pod. Which volume type should you use in the pod spec?
⚠ Common exam trap
Watch out — candidates often confuse ConfigMap and Secret volume types, thinking ConfigMap can mount Secrets because both store key-value data, but Kubernetes enforces strict separation: Secrets require the 'secret' volume type for security and proper handling of sensitive data.
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
✓
secret
Kubernetes provides a dedicated 'secret' volume type specifically designed to mount Secret objects (like 'db-secret') as files into a pod. This volume type automatically handles decryption and projection of the secret data into the container's filesystem, ensuring sensitive information is securely exposed without being stored in the pod definition or environment variables.
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 type mounts a file or directory directly from the underlying host node's filesystem into your Pod. It does not have native integration with Kubernetes Secret objects stored in etcd. Using it for secrets would require manually provisioning the sensitive files on the host node, which exposes security risks and bypasses Kubernetes secret management.
- ✗
configMap
Why it's wrong here
The configMap volume source is specifically designed to inject non-sensitive configuration data stored in a Kubernetes ConfigMap resource into a Pod. It cannot reference or retrieve data from a Secret object. Attempting to mount a Secret using this volume type will result in a validation error when applying the Pod manifest.
- ✗
emptyDir
Why it's wrong here
An emptyDir volume is an ephemeral storage space created when a Pod is assigned to a node, starting out completely empty. While it can share temporary files between containers in the same Pod, it cannot automatically fetch or expose pre-existing Kubernetes Secret resources. It is entirely unsuited for securely mounting external sensitive data.
- ✓
secret
Why this is correct
The secret volume type is the correct mechanism to securely mount a Kubernetes Secret resource as a directory containing sensitive files. Each key in the secret's data map is projected as an individual file within the specified mount path. This volume is backed by tmpfs (RAM-backed storage) to ensure sensitive data is never written to physical disk on the node.
Go deeper
Related to this question
Learn chapter
Kubernetes Architecture Overview
Key term
Ingress Resources
Ingress Resources are Kubernetes API objects that manage external access to services inside a cluster, typically HTTP and HTTPS traffic, by defining rules for routing requests based on hostnames and paths.
Key term
Network Policies
A Kubernetes resource that controls how pods communicate with each other and with other network endpoints, acting as a firewall for pod-to-pod traffic.
About these practice questions
One of 726 original CKA 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 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.