Bird
0
0

Given the command kubectl create configmap my-config --from-file=app.properties, what will be the key name inside the ConfigMap if the file is named app.properties?

medium📝 Command Output Q13 of 15
Kubernetes - ConfigMaps
Given the command kubectl create configmap my-config --from-file=app.properties, what will be the key name inside the ConfigMap if the file is named app.properties?
Aapp
Bmy-config
Capp.properties
Dconfigmap
Step-by-Step Solution
Solution:
  1. Step 1: Understand key naming in ConfigMaps from files

    When creating a ConfigMap from a file without specifying a key, the filename is used as the key.
  2. Step 2: Apply to given filename

    Since the file is named app.properties, the key inside the ConfigMap will be app.properties.
  3. Final Answer:

    app.properties -> Option C
  4. Quick Check:

    Filename = key name in ConfigMap [OK]
Quick Trick: Filename becomes key if no key specified [OK]
Common Mistakes:
  • Assuming ConfigMap name is the key
  • Using partial filename as key
  • Confusing key with ConfigMap name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes