Bird
0
0

Which Kubernetes object is used to inject environment variables from a ConfigMap into a container?

easy📝 Conceptual Q2 of 15
Kubernetes - ConfigMaps
Which Kubernetes object is used to inject environment variables from a ConfigMap into a container?
AenvFrom
BserviceAccount
CvolumeMounts
DnodeSelector
Step-by-Step Solution
Solution:
  1. Step 1: Identify environment variable injection method

    Kubernetes uses the envFrom field to load all keys from a ConfigMap as environment variables.
  2. Step 2: Differentiate from other fields

    volumeMounts mounts files, serviceAccount manages permissions, and nodeSelector schedules pods.
  3. Final Answer:

    envFrom -> Option A
  4. Quick Check:

    Inject env vars = envFrom [OK]
Quick Trick: Use envFrom to load all ConfigMap keys as env vars [OK]
Common Mistakes:
  • Using volumeMounts to inject env vars
  • Confusing serviceAccount with env injection
  • Using nodeSelector for env vars

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes