Bird
0
0

Given a Secret created with kubectl create secret generic db-secret --from-literal=password=pass123, what will kubectl get secret db-secret -o jsonpath='{.data.password}' output?

medium📝 Command Output Q4 of 15
Kubernetes - Secrets
Given a Secret created with kubectl create secret generic db-secret --from-literal=password=pass123, what will kubectl get secret db-secret -o jsonpath='{.data.password}' output?
Apass123
Bpassword=pass123
CError: secret not found
DcGFzczEyMw==
Step-by-Step Solution
Solution:
  1. Step 1: Understand Secret data storage

    Kubernetes stores Secret data base64 encoded, so the password is encoded before storage.
  2. Step 2: Decode the password 'pass123' to base64

    The base64 encoding of 'pass123' is 'cGFzczEyMw=='.
  3. Final Answer:

    cGFzczEyMw== -> Option D
  4. Quick Check:

    Secret data output = base64 encoded string [OK]
Quick Trick: Secret data output is base64 encoded, not plain text [OK]
Common Mistakes:
  • Expecting plain text output
  • Confusing key-value with encoded value
  • Assuming error if Secret exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes