Bird
0
0

You want to create a ConfigMap from literals but also include a file. Which command correctly combines literals and a file named config.txt?

hard📝 Workflow Q9 of 15
Kubernetes - ConfigMaps
You want to create a ConfigMap from literals but also include a file. Which command correctly combines literals and a file named config.txt?
Akubectl create configmap combined-config --from-literal key1 value1 --from-file config.txt
Bkubectl create configmap combined-config --from-literal=key1=value1 config.txt
Ckubectl create configmap combined-config --from-literal=key1=value1 --from-file=config.txt
Dkubectl create configmap combined-config --from-file=config.txt --from-literal=key1 value1
Step-by-Step Solution
Solution:
  1. Step 1: Understand combining literals and files

    You can combine --from-literal and --from-file flags in one command.
  2. Step 2: Check correct syntax

    kubectl create configmap combined-config --from-literal=key1=value1 --from-file=config.txt correctly uses --from-literal=key=value and --from-file=filename with equal signs.
  3. Final Answer:

    kubectl create configmap combined-config --from-literal=key1=value1 --from-file=config.txt -> Option C
  4. Quick Check:

    Combine literals and files with separate flags and equal signs [OK]
Quick Trick: Use separate flags with '=' for literals and files [OK]
Common Mistakes:
  • Omitting equal signs
  • Passing file without --from-file flag
  • Mixing flag order incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes