Bird
0
0

If a ConfigMap key named config.yaml contains multiple lines, how will it appear inside the container when mounted as a volume?

medium📝 Command Output Q5 of 15
Kubernetes - ConfigMaps
If a ConfigMap key named config.yaml contains multiple lines, how will it appear inside the container when mounted as a volume?
AAs a single line with all lines concatenated
BOnly the first line is saved in the file
CAs a multi-line file preserving all lines
DThe file will be empty
Step-by-Step Solution
Solution:
  1. Step 1: Recall ConfigMap multi-line support

    ConfigMap values can contain multi-line strings and are preserved exactly when mounted as files.
  2. Step 2: Confirm file content behavior

    The file inside the container will have all lines as in the ConfigMap key value, preserving line breaks.
  3. Final Answer:

    As a multi-line file preserving all lines -> Option C
  4. Quick Check:

    Multi-line ConfigMap values = multi-line files [OK]
Quick Trick: Multi-line ConfigMap values keep line breaks in files [OK]
Common Mistakes:
  • Assuming lines get concatenated into one
  • Thinking only first line is saved
  • Expecting empty files for multi-line values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes