Bird
0
0

Given this pod spec snippet, what environment variables will be available inside the container?

medium📝 Command Output Q13 of 15
Kubernetes - ConfigMaps
Given this pod spec snippet, what environment variables will be available inside the container?
envFrom:
  - configMapRef:
      name: my-config
And the ConfigMap my-config contains keys: API_URL=https://api.example.com and TIMEOUT=30.
AOnly API_URL=https://api.example.com
BAPI_URL=https://api.example.com and TIMEOUT=30
COnly TIMEOUT=30
DNo environment variables will be set
Step-by-Step Solution
Solution:
  1. Step 1: Understand envFrom with configMapRef

    Using envFrom with configMapRef loads all keys from the ConfigMap as environment variables.
  2. Step 2: Check ConfigMap keys

    The ConfigMap has two keys: API_URL and TIMEOUT, so both become env vars.
  3. Final Answer:

    API_URL=https://api.example.com and TIMEOUT=30 -> Option B
  4. Quick Check:

    envFrom loads all keys as env vars [OK]
Quick Trick: envFrom loads all ConfigMap keys as env vars [OK]
Common Mistakes:
  • Assuming only one key loads at a time
  • Confusing envFrom with env and missing keys
  • Thinking ConfigMap keys are not environment variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes