Bird
0
0

You tried to create a secret with the command kubectl create secret generic mysecret --from-literal password pass123 but got an error. What is the likely cause?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Secrets
You tried to create a secret with the command kubectl create secret generic mysecret --from-literal password pass123 but got an error. What is the likely cause?
AYou need to add --type=generic flag explicitly
BSecret name 'mysecret' is invalid
CThe password value is too short
DMissing '=' sign between key and value in --from-literal
Step-by-Step Solution
Solution:
  1. Step 1: Check the syntax of --from-literal flag

    The correct syntax requires an '=' sign between key and value, like --from-literal=key=value.
  2. Step 2: Identify the error in the command

    The command uses a space instead of '=', causing a syntax error.
  3. Final Answer:

    Missing '=' sign between key and value in --from-literal -> Option D
  4. Quick Check:

    --from-literal needs '=' between key and value = A [OK]
Quick Trick: Use '=' in --from-literal key=value, no spaces [OK]
Common Mistakes:
  • Using space instead of '=' in --from-literal
  • Assuming secret name rules cause error
  • Thinking --type=generic is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes