Bird
0
0

Which command creates a secret from a literal key-value pair in Kubernetes?

easy📝 Conceptual Q2 of 15
Kubernetes - Secrets
Which command creates a secret from a literal key-value pair in Kubernetes?
Akubectl create secret generic mysecret --from-literal=password=12345
Bkubectl secret create mysecret --key=password=12345
Ckubectl create secret mysecret --literal=password=12345
Dkubectl create secret generic mysecret -k password=12345
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct syntax for creating a secret from literal

    The correct command uses 'kubectl create secret generic' with '--from-literal' to specify key-value pairs.
  2. Step 2: Validate the options

    Only kubectl create secret generic mysecret --from-literal=password=12345 uses the correct command and flag syntax.
  3. Final Answer:

    kubectl create secret generic mysecret --from-literal=password=12345 -> Option A
  4. Quick Check:

    Secret creation from literal = --from-literal [OK]
Quick Trick: Use --from-literal to add key-value pairs directly [OK]
Common Mistakes:
  • Using wrong flags like --key or -k
  • Omitting 'generic' keyword
  • Incorrect command order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes