KCNA Kubernetes Fundamentals Practice Question
You need to securely store a database password for use by a Pod. Which Kubernetes resource should you use?
⚠ Common exam trap
CNCF often tests the misconception that ConfigMaps are suitable for all configuration data, including sensitive values, but the KCNA exam expects you to know that Secrets are the dedicated resource for confidential information like passwords and API keys.
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
A Secret is the correct Kubernetes resource for storing sensitive data like database passwords because it encodes the value in base64 and can be mounted as a volume or injected as an environment variable into a Pod. Unlike ConfigMaps, Secrets are designed for confidential information and support optional encryption at rest when enabled in the cluster. This ensures the password is not stored in plaintext in the Pod specification or version control.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Secret
Why this is correct
Secrets are intended for sensitive information.
- ✗
PersistentVolumeClaim
Why it's wrong here
PVCs request storage.
- ✗
ServiceAccount
Why it's wrong here
ServiceAccounts are for identity.
- ✗
ConfigMap
Why it's wrong here
ConfigMaps store non-sensitive configuration data.
Go deeper
Related to this question
About these practice questions
One of 833 original KCNA 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 →
Same concept, more angles
3 more ways this is tested on KCNA
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which Kubernetes object can be used to store sensitive data, such as passwords or API keys, and inject them into pods?
medium- A.PersistentVolume
- B.ServiceAccount
- ✓ C.Secret
- D.ConfigMap
Why C: A Secret is the dedicated Kubernetes object for storing sensitive data like passwords, API keys, and tokens. Secrets store data as base64-encoded strings and can be injected into pods as environment variables or mounted as volumes, with optional encryption at rest via etcd or KMS.
Variation 2. You need to store a database password securely and expose it to a Pod as an environment variable. Which Kubernetes resource should you use?
medium- A.Service
- B.PersistentVolumeClaim
- ✓ C.Secret
- D.ConfigMap
Why C: A Secret is the correct Kubernetes resource for storing sensitive data like database passwords because it encodes the value in base64 and can be injected into a Pod as an environment variable. Unlike ConfigMaps, Secrets are designed for confidential information and support optional encryption at rest when etcd is configured accordingly.
Variation 3. You need to store a sensitive database password in Kubernetes. Which resource should you use?
medium- A.PersistentVolume
- B.ConfigMap
- C.ServiceAccount
- ✓ D.Secret
Why D: A Secret is the correct Kubernetes resource for storing sensitive data like database passwords because it encodes the data in base64 and is designed to be consumed securely by pods, with access controlled via RBAC. Unlike ConfigMaps, Secrets are not intended for non-sensitive configuration and provide a layer of separation for confidential information.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This KCNA 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 KCNA exam.