Courseiva
Workloads and Scheduling →easyMultiple Select

CKA Workloads and Scheduling Practice Question

Which TWO of the following are valid methods to expose ConfigMap data to pods?

⚠ Common exam trap

It's easy for candidates to confuse 'exposing data to pods' with 'using data in pod definitions,' leading them to select command arguments (option C) as a direct method, when in fact command arguments require an intermediate exposure method like environment variables or volume mounts to supply the ConfigMap values.

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

✓

As environment variables

Option A is correct because a ConfigMap can be consumed via envFrom or valueFrom.configMapKeyRef in a container's env, injecting keys as environment variables. Option E is correct because a ConfigMap can be mounted as a volume, where each key becomes a file in the mounted directory, allowing applications to read configuration from the filesystem. Option B is incorrect because a Kubernetes Service provides network access to pods, not a mechanism to inject ConfigMap data. Option C is incorrect because container command arguments are set in the pod spec and are not a native ConfigMap exposure method, though values could be referenced indirectly. Option D is incorrect because annotations are metadata attached to objects and are not a supported way to expose ConfigMap data to containers.

Answer analysis

Option-by-option breakdown

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

  • ✓

    As environment variables

    Why this is correct

    A ConfigMap can be injected into a Pod as environment variables using the `configMapKeyRef` field in the container's `env` definition. This pulls a specific key's value into an environment variable, and `envFrom` can be used to load all keys as environment variables automatically. This is a valid, declarative method to expose configuration data to processes inside the container.

  • ✗

    As a Kubernetes Service

    Why it's wrong here

    A Kubernetes Service is a networking abstraction that provides a stable IP address and DNS name to route traffic to a set of Pods. Services expose Pod endpoints to other workloads or external clients, but they cannot carry ConfigMap data because ConfigMaps are API objects consumed only by Pods at runtime, not network services. Therefore, a Service is not a mechanism for exposing configuration contents.

  • ✗

    As a container command argument

    Why it's wrong here

    While container command arguments can reference environment variables using the `$(VAR_NAME)` syntax, they cannot directly reference a ConfigMap or one of its keys. To use ConfigMap data in an argument, you must first create an environment variable from the ConfigMap via `configMapKeyRef` and then reference that variable in `args`. This indirection makes command arguments an indirect, not direct, method of exposing ConfigMap data.

  • ✗

    As a Pod annotation

    Why it's wrong here

    Pod annotations are key-value metadata attached to an object for informational or tooling purposes, such as release versions or contact info. They are not made available to containers as files or environment variables, and they are not a supported channel for consuming configuration data at runtime. Therefore, using annotations to expose ConfigMap contents is not a valid method.

  • ✓

    As a volume mount

    Why this is correct

    A ConfigMap can be mounted into a Pod as a volume, where each key becomes a file in the specified mount path and the value becomes the file's contents. Containers read these files directly from the filesystem, allowing application code to load configuration without environment variable constraints. This is a valid method and supports mechanisms like `subPath` to mount individual keys at specific file locations.

About these practice questions

Courseiva writes every CKA question from scratch — 726 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 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.