Bird
0
0

You run kubectl create secret tls mytlssecret --cert=cert.pem but get an error. What is the likely cause?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Secrets
You run kubectl create secret tls mytlssecret --cert=cert.pem but get an error. What is the likely cause?
AUsing wrong secret type, should be opaque
BMissing --key flag with private key file
CCertificate file is empty
DSecret name contains invalid characters
Step-by-Step Solution
Solution:
  1. Step 1: Check required flags for TLS secret

    Creating TLS secrets requires both --cert and --key flags to specify certificate and private key files.
  2. Step 2: Identify missing flag

    The command only has --cert but lacks --key, causing the error.
  3. Final Answer:

    Missing --key flag with private key file -> Option B
  4. Quick Check:

    Both --cert and --key required for TLS secret [OK]
Quick Trick: TLS secrets need both --cert and --key flags [OK]
Common Mistakes:
  • Omitting the --key flag when creating TLS secrets
  • Using opaque type instead of TLS for certs
  • Assuming secret name format causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes