Bird
0
0

Which of the following is the correct way to create a Secret in Kubernetes using a literal value?

easy📝 Conceptual Q12 of 15
Microservices - Orchestration with Kubernetes
Which of the following is the correct way to create a Secret in Kubernetes using a literal value?
Akubectl create secret generic mysecret --from-literal=password=12345
Bkubectl create configmap mysecret --from-literal=password=12345
Ckubectl secret create mysecret --from-file=password.txt
Dkubectl create secret mysecret --password=12345
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kubernetes Secret creation syntax

    The correct command uses kubectl create secret generic with --from-literal to create a secret from a literal key-value pair.
  2. Step 2: Eliminate incorrect options

    kubectl create configmap mysecret --from-literal=password=12345 uses configmap instead of secret, kubectl secret create mysecret --from-file=password.txt uses wrong command syntax, kubectl create secret mysecret --password=12345 uses invalid flag.
  3. Final Answer:

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

    Secret creation uses 'kubectl create secret generic' [OK]
Quick Trick: Secret creation uses 'kubectl create secret generic' [OK]
Common Mistakes:
MISTAKES
  • Using configmap command instead of secret
  • Wrong flags like --password
  • Confusing file and literal input

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes