KCNA Kubernetes Fundamentals Practice Question
You need to store a database password securely and expose it to a Pod as an environment variable. Which Kubernetes resource should you use?
⚠ Common exam trap
Many candidates mistakenly assume that ConfigMaps are suitable for all configuration data, including passwords. However, Secrets are specifically designed for sensitive information and support optional encryption at rest, whereas ConfigMaps store data in plain text.
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 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.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Service
Why it's wrong here
Services provide networking endpoints, not configuration data.
- ✗
PersistentVolumeClaim
Why it's wrong here
PVCs are used for persistent storage, not for storing configuration data.
- ✓
Secret
Why this is correct
Secrets store sensitive data, such as passwords, and can be injected into Pods as environment variables or volumes.
- ✗
ConfigMap
Why it's wrong here
ConfigMaps are for non-sensitive configuration data; passwords should be stored in Secrets.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 833-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 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.