Bird
0
0

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

medium📝 Command Output Q4 of 15
Kubernetes - ConfigMaps
Given this pod spec snippet, what environment variables will be available inside the container?
envFrom:
- configMapRef:
name: app-config

Assuming app-config contains keys API_URL and TIMEOUT.
AOnly TIMEOUT will be set as environment variable
BAPI_URL and TIMEOUT environment variables with their ConfigMap values
COnly API_URL will be set as environment variable
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: Apply to given keys

    Since app-config has API_URL and TIMEOUT, both become env vars.
  3. Final Answer:

    API_URL and TIMEOUT environment variables with their ConfigMap values -> Option B
  4. Quick Check:

    envFrom loads all keys = API_URL + TIMEOUT [OK]
Quick Trick: envFrom loads all ConfigMap keys as env vars [OK]
Common Mistakes:
  • Assuming envFrom sets no variables
  • Thinking only one key is loaded
  • Confusing envFrom with volume mounts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes