Bird
0
0

Which YAML snippet correctly represents a Kubernetes Secret named db-secret with a Base64 encoded key password having the value c2VjdXJlcGFzcw==?

easy📝 Configuration Q3 of 15
Kubernetes - Secrets
Which YAML snippet correctly represents a Kubernetes Secret named db-secret with a Base64 encoded key password having the value c2VjdXJlcGFzcw==?
AapiVersion: v1 kind: Secret metadata: name: db-secret data: password: c2VjdXJlcGFzcw==
BapiVersion: v1 kind: Secret metadata: name: db-secret stringData: password: c2VjdXJlcGFzcw==
CapiVersion: v1 kind: Secret metadata: name: db-secret data: password: securepass
DapiVersion: v1 kind: Secret metadata: name: db-secret stringData: password: securepass
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct field for Base64 data

    Base64 encoded data must be under the data field.
  2. Step 2: Check value encoding

    The value c2VjdXJlcGFzcw== is Base64 encoded, so it belongs under data, not stringData.
  3. Step 3: Validate YAML structure

    apiVersion: v1 kind: Secret metadata: name: db-secret data: password: c2VjdXJlcGFzcw== correctly uses data with Base64 encoded value and proper metadata.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Base64 data goes in data field [OK]
Quick Trick: Base64 encoded values go under 'data' field [OK]
Common Mistakes:
  • Putting Base64 encoded values under stringData
  • Using plain text in data field
  • Incorrect YAML indentation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes