Bird
0
0

Given this pod spec snippet mounting a ConfigMap named app-config at /etc/config, what will be the content of the file /etc/config/settings.conf inside the container?

medium📝 Command Output Q4 of 15
Kubernetes - ConfigMaps
Given this pod spec snippet mounting a ConfigMap named app-config at /etc/config, what will be the content of the file /etc/config/settings.conf inside the container?
volumes:
- name: config-volume
  configMap:
    name: app-config
containers:
- name: app
  image: nginx
  volumeMounts:
  - name: config-volume
    mountPath: /etc/config

Assuming the ConfigMap app-config has a key settings.conf with value max_connections=100.
AError: file not found
Bmax_connections=100
Csettings.conf
DEmpty file
Step-by-Step Solution
Solution:
  1. Step 1: Understand ConfigMap keys as files

    Each key in the ConfigMap becomes a file with the key's value as content inside the mounted path.
  2. Step 2: Apply to given example

    The key 'settings.conf' with value 'max_connections=100' becomes the file content at /etc/config/settings.conf.
  3. Final Answer:

    max_connections=100 -> Option B
  4. Quick Check:

    ConfigMap key content = file content [OK]
Quick Trick: ConfigMap keys become files with their values as content [OK]
Common Mistakes:
  • Expecting filename as content instead of file content
  • Assuming file is empty or missing
  • Confusing key names with file content

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes