Bird
0
0

Which of the following is the correct command to create a generic secret named mysecret with a literal key-value pair username=admin?

easy📝 Syntax Q12 of 15
Kubernetes - Secrets
Which of the following is the correct command to create a generic secret named mysecret with a literal key-value pair username=admin?
Akubectl create secret generic mysecret --from-literal=username=admin
Bkubectl secret create generic mysecret --literal=username=admin
Ckubectl create secret mysecret --literal username=admin
Dkubectl create secret generic mysecret username=admin
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct syntax for creating a generic secret

    The correct command uses kubectl create secret generic [name] --from-literal=key=value.
  2. Step 2: Match the options with the correct syntax

    Only kubectl create secret generic mysecret --from-literal=username=admin matches the exact syntax with correct flags and order.
  3. Final Answer:

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

    Correct syntax uses --from-literal=key=value = D [OK]
Quick Trick: Use --from-literal=key=value with create secret generic [OK]
Common Mistakes:
  • Using wrong flag names like --literal
  • Omitting 'generic' keyword
  • Incorrect order of arguments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes