Bird
0
0

Which of the following is the correct command to create a TLS secret named mytls using files tls.crt and tls.key?

easy📝 Syntax Q3 of 15
Kubernetes - Secrets
Which of the following is the correct command to create a TLS secret named mytls using files tls.crt and tls.key?
Akubectl create secret opaque mytls --cert=tls.crt --key=tls.key
Bkubectl create secret tls mytls --cert=tls.crt --key=tls.key
Ckubectl create secret docker-registry mytls --cert=tls.crt --key=tls.key
Dkubectl create secret generic mytls --cert=tls.crt --key=tls.key
Step-by-Step Solution
Solution:
  1. Step 1: Recall TLS secret creation syntax

    The correct command uses 'create secret tls' with --cert and --key flags.
  2. Step 2: Verify options

    Options A, B, and D use wrong secret types or flags; only 'tls' accepts --cert and --key flags.
  3. Final Answer:

    kubectl create secret tls mytls --cert=tls.crt --key=tls.key -> Option B
  4. Quick Check:

    TLS secret creation uses 'create secret tls' [OK]
Quick Trick: Use 'kubectl create secret tls' with cert and key files [OK]
Common Mistakes:
  • Using docker-registry or opaque instead of tls
  • Using generic secret with cert/key flags
  • Mixing up file flags or secret names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes