Courseiva
Workloads and Scheduling →easyMultiple Choice

CKA Workloads and Scheduling Practice Question

Which of the following is a valid way to mount a Secret as a volume in a Pod?

⚠ Common exam trap

Candidates often confuse the syntax for mounting a Secret with that of a ConfigMap, or incorrectly assume that `secretName` can be used as a top-level field without the `secret` key, leading them to pick option B.

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

✓

volumes: - name: secret-volume secret: secretName: my-secret

It uses the `secret` volume type with the `secretName` field to reference a Kubernetes Secret object. This is the standard syntax for mounting a Secret as a volume in a Pod, allowing the Secret's data to be exposed as files in the container's filesystem.

Answer analysis

Option-by-option breakdown

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

  • ✓

    volumes: - name: secret-volume secret: secretName: my-secret

    Why this is correct

    This is the correct syntax for mounting a Kubernetes Secret as a volume. The 'secret' volume source must be declared directly under the volume's name, and the 'secretName' field nested within it specifies the exact Secret resource to retrieve from the namespace.

  • ✗

    volumes: - name: secret-volume secretName: my-secret

    Why it's wrong here

    This syntax is invalid because 'secretName' is not a direct child of the volume list item. Kubernetes requires the 'secret' block to be explicitly defined first, and then 'secretName' must be nested inside that block to properly identify the target Secret.

  • ✗

    volumes: - name: secret-volume configMap: name: my-secret

    Why it's wrong here

    This configuration attempts to mount a ConfigMap instead of a Secret. While both are configuration resources, a ConfigMap cannot retrieve or expose sensitive data stored in a Secret resource, making this schema incorrect for mounting secrets.

  • ✗

    volumes: - name: secret-volume hostPath: path: /etc/secret

    Why it's wrong here

    This option uses the 'hostPath' volume source, which mounts a directory or file from the host node's filesystem into the pod. It does not reference or retrieve any Kubernetes Secret resource managed by the control plane.

About these practice questions

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