Bird
0
0

Which of the following is the correct YAML snippet to mount a ConfigMap named app-config as a volume in a pod?

easy📝 Configuration Q12 of 15
Kubernetes - ConfigMaps
Which of the following is the correct YAML snippet to mount a ConfigMap named app-config as a volume in a pod?
Avolumes:\n - name: config-volume\n emptyDir: {}
Bvolumes:\n - name: config-volume\n secret:\n name: app-config
Cvolumes:\n - name: config-volume\n persistentVolumeClaim:\n claimName: app-config
Dvolumes:\n - name: config-volume\n configMap:\n name: app-config
Step-by-Step Solution
Solution:
  1. Step 1: Identify volume type for ConfigMap

    ConfigMaps are mounted using the configMap field inside volumes.
  2. Step 2: Match correct YAML structure

    volumes:\n - name: config-volume\n configMap:\n name: app-config correctly uses configMap: with the ConfigMap name.
  3. Final Answer:

    volumes:\n - name: config-volume\n configMap:\n name: app-config -> Option D
  4. Quick Check:

    ConfigMap volume uses configMap: name [OK]
Quick Trick: ConfigMap volume uses 'configMap:' with name [OK]
Common Mistakes:
  • Using secret instead of configMap for ConfigMap volumes
  • Confusing persistentVolumeClaim with ConfigMap
  • Using emptyDir which is an empty temp volume

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes