nerdexam
Docker

DCA · Question #90

You want to provide a configuration file to a container at runtime. Does this set of Kubernetes tools and steps accomplish this? Solution: Turn the configuration file into a configMap object and…

The correct answer is B. No. While using a ConfigMap is the correct approach to provide configuration files, the .spec.containers.configMounts key is an incorrect and non-existent method for mounting them into a container.

Submitted by khalil_dz· Apr 18, 2026Container Orchestration

Question

You want to provide a configuration file to a container at runtime. Does this set of Kubernetes tools and steps accomplish this? Solution: Turn the configuration file into a configMap object and mount it directly into the appropriate pod and container using the .spec.containers.configMounts key.

Options

  • AYes
  • BNo

How the community answered

(25 responses)
  • A
    20% (5)
  • B
    80% (20)

Why each option

While using a ConfigMap is the correct approach to provide configuration files, the `.spec.containers.configMounts` key is an incorrect and non-existent method for mounting them into a container.

AYes

The method for mounting ConfigMaps into containers is via volumes and volume mounts (`.spec.volumes` and `.spec.containers.volumeMounts`), not through a non-existent key like `.spec.containers.configMounts`.

BNoCorrect

To provide a configuration file from a ConfigMap to a container, you define the ConfigMap and then mount it into the container's filesystem using a `volume` and `volumeMount` specification under `.spec.volumes` and `.spec.containers.volumeMounts`, respectively. The `.spec.containers.configMounts` key does not exist in the Kubernetes API for mounting ConfigMaps.

Concept tested: Kubernetes ConfigMap mounting

Source: https://kubernetes.io/docs/tasks/configure-pod-container/configure-a-pod-configmap/#add-configmap-data-to-a-volume

Topics

#Kubernetes#ConfigMap#Volume Mounts#Pod Configuration

Community Discussion

No community discussion yet for this question.

Full DCA Practice