Bird
0
0

Given this pod spec snippet, what will be the value of environment variable DB_PASSWORD inside the container?

medium📝 Analysis Q4 of 15
Microservices - Orchestration with Kubernetes
Given this pod spec snippet, what will be the value of environment variable DB_PASSWORD inside the container?
env:
  - name: DB_PASSWORD
    valueFrom:
      secretKeyRef:
        name: db-secret
        key: password
AThe literal string 'db-secret'
BThe value of the 'password' key in the 'db-secret' Secret
CAn empty string
DThe name of the Secret object
Step-by-Step Solution
Solution:
  1. Step 1: Understand valueFrom with secretKeyRef

    The environment variable is set from a key inside a Secret named 'db-secret'.
  2. Step 2: Identify the key used

    The key specified is 'password', so the value will be the Secret's 'password' data.
  3. Final Answer:

    The value of the 'password' key in the 'db-secret' Secret -> Option B
  4. Quick Check:

    Secret key reference sets env var = C [OK]
Quick Trick: secretKeyRef pulls specific key value from Secret [OK]
Common Mistakes:
MISTAKES
  • Using Secret name as value instead of key's value
  • Assuming literal string is used
  • Expecting empty string if key missing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes