300-910 · Question #9
ConfigMap keys have been mapped to different file names using the volumes.configMap.items field. What is the result if a wrong ConfigMap key is specified?
The correct answer is B. The volume is not created.. If an incorrect ConfigMap key is specified when projecting specific keys to files within a volume, Kubernetes will fail to create the volume because the source key does not exist.
Question
Options
- AThe default path is not used.
- BThe volume is not created.
- CThe volume is created.
- DThe volume is created with errors.
How the community answered
(26 responses)- B88% (23)
- C8% (2)
- D4% (1)
Why each option
If an incorrect ConfigMap key is specified when projecting specific keys to files within a volume, Kubernetes will fail to create the volume because the source key does not exist.
The default path would not be used because the issue is with a specified key that doesn't exist, preventing the volume's content from being mapped as intended.
When using `volumes.configMap.items` to selectively project specific ConfigMap keys as files into a volume, Kubernetes validates that the specified keys actually exist within the referenced ConfigMap. If a wrong or non-existent key is specified, the volume mounting will fail, and thus the volume will not be created successfully with the requested content.
The volume would not be created successfully with the specified content; instead, the pod would likely fail to start due to the inability to mount the volume as configured.
While 'with errors' is vague, the more precise outcome is that the volume creation or mounting operation fails entirely, preventing the pod from reaching a running state.
Concept tested: Kubernetes ConfigMap volume mounting errors
Source: https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically
Topics
Community Discussion
No community discussion yet for this question.