Courseiva
Kubernetes Fundamentals →mediumMultiple Choice

KCNA Kubernetes Fundamentals Practice Question

You need to store a database password securely and make it available to a Pod as an environment variable. Which Kubernetes resource should you create?

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

Secrets are designed to store sensitive data, such as passwords, and can be exposed to Pods via environment variables or volumes.

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

    A Secret stores sensitive data such as passwords separately from pod specs, and it can be injected into a container as an environment variable via envFrom or valueFrom.secretKeyRef, satisfying the stem's secure storage and environment variable constraints.

  • ✗

    PersistentVolume

    Why it's wrong here

    A PersistentVolume provides durable block or file storage mounted into a Pod's filesystem; it cannot deliver a value as an environment variable. It is tempting because databases need persistent storage, but the requirement here is secret injection, not volume provisioning.

  • ✗

    ConfigMap

    Why it's wrong here

    ConfigMap data is stored unencrypted in etcd and readable by anyone with get access, so it fails the secure-storage requirement for a password. It is tempting because ConfigMaps do expose values as environment variables, and they are the correct choice for non-sensitive configuration such as feature flags.

  • ✗

    ServiceAccount

    Why it's wrong here

    A ServiceAccount supplies an identity token for API authentication, not arbitrary secret data, so it cannot inject a password into a container environment. It is tempting because ServiceAccounts are mounted into Pods automatically, but they suit granting workloads RBAC permissions, not storing credentials.

About these practice questions

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