Bird
0
0

You attempt to create a ConfigMap using this command:

medium📝 Troubleshoot Q6 of 15
Kubernetes - ConfigMaps
You attempt to create a ConfigMap using this command:
kubectl create configmap mymap --from-literal=key1 value1

but it fails. What is the cause of the error?
AThe syntax is incorrect; the key-value pair must be joined with '=' without spaces.
BThe ConfigMap name 'mymap' is invalid and must be in uppercase.
CThe command requires the --from-file option instead of --from-literal.
DThe key 'key1' cannot be used as it is a reserved keyword.
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command syntax

    The command uses --from-literal=key1 value1 which separates key and value by a space.
  2. Step 2: Correct syntax for literals

    The correct syntax requires the key and value to be joined by an equals sign with no spaces, like --from-literal=key1=value1.
  3. Final Answer:

    The syntax is incorrect; the key-value pair must be joined with '=' without spaces. -> Option A
  4. Quick Check:

    Check for '=' between key and value [OK]
Quick Trick: Use '=' to join key and value in --from-literal [OK]
Common Mistakes:
  • Using space instead of '=' between key and value
  • Trying to use uppercase names for ConfigMaps
  • Confusing --from-literal with --from-file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes