Courseiva
Kubernetes Fundamentals →mediumMultiple Choice

KCNA Kubernetes Fundamentals Practice Question

You need to store a sensitive database password in Kubernetes. Which resource should you use?

⚠ Common exam trap

The most common mistake is selecting ConfigMap instead of Secret, because both can hold key-value data, but Secret is designed for sensitive information and provides base64 encoding as a basic security measure, while ConfigMap is for non-sensitive configuration.

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 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.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    PersistentVolume

    Why it's wrong here

    PersistentVolume provides durable block or file storage mounted into pods; it has no mechanism for holding discrete credential values. It suits stateful workloads needing retained data across restarts. A database password requires a Secret, which stores sensitive key-value pairs separately from application data.

  • ✗

    ConfigMap

    Why it's wrong here

    ConfigMap stores configuration as plaintext, readable by anyone with get access in the namespace, exposing the password. It suits non-sensitive settings such as feature flags or environment names. Sensitive credentials belong in a Secret, which supports base64 encoding and restricted RBAC.

  • ✗

    ServiceAccount

    Why it's wrong here

    A ServiceAccount provides an identity for pods to authenticate to the Kubernetes API; it holds no arbitrary credential storage. It suits workload authentication and token projection. A database password needs a Secret object, which is designed for confidential key-value data.

  • ✓

    Secret

    Why this is correct

    Secrets store base64-encoded data separately from pod specs and images, satisfying the need to keep credentials out of container definitions. They can be mounted as volumes or injected as environment variables, and access is restricted via RBAC and encryption at rest.

Quick reference

Access Control Model Comparison

ModelAcronymWho Controls Access?Best For
Discretionary Access ControlDACResource ownerSmall teams, file shares
Mandatory Access ControlMACSystem / security labelsClassified govt / military
Role-Based Access ControlRBACAdministrator (via roles)Enterprise environments
Attribute-Based Access ControlABACPolicy engine (user + resource attributes)Fine-grained, dynamic policies
Rule-Based Access ControlRuBACSystem rules / ACLsFirewall rules, network ACLs

About these practice questions

Courseiva writes every KCNA question from scratch — 930 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 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.