Bird
0
0

Which of the following is the correct syntax to load all keys from a ConfigMap named app-config as environment variables in a pod spec?

easy📝 Syntax Q12 of 15
Kubernetes - ConfigMaps
Which of the following is the correct syntax to load all keys from a ConfigMap named app-config as environment variables in a pod spec?
AenvFrom: - configMapRef: name: app-config
Benv: - name: app-config valueFrom: configMapKeyRef: name: app-config
CconfigMap: name: app-config
DenvFrom: - secretRef: name: app-config
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct envFrom usage

    To load all keys as env vars, use envFrom with configMapRef and the ConfigMap name.
  2. Step 2: Check options for syntax correctness

    envFrom: - configMapRef: name: app-config correctly uses envFrom with configMapRef. Others misuse keys or use secretRef incorrectly.
  3. Final Answer:

    envFrom: - configMapRef: name: app-config -> Option A
  4. Quick Check:

    Use envFrom + configMapRef for all keys [OK]
Quick Trick: Use envFrom with configMapRef to load all keys [OK]
Common Mistakes:
  • Using env instead of envFrom for all keys
  • Confusing configMapRef with secretRef
  • Missing indentation or wrong key names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes