Bird
0
0

You want to create a ConfigMap named app-settings with these key-value pairs:

hard📝 Application Q15 of 15
Kubernetes - ConfigMaps
You want to create a ConfigMap named app-settings with these key-value pairs:
env=production, debug=false, and timeout=0. You run:
kubectl create configmap app-settings --from-literal=env=production --from-literal=debug=false --from-literal=timeout=0

Later, you mount this ConfigMap as environment variables in a Pod. What should you be careful about regarding the timeout value?
AThe timeout key will be converted to boolean false automatically
BThe value '0' will be ignored because it is falsy
CThe value '0' is a string and will be passed as "0", not as a number zero
DThe ConfigMap will fail to create because '0' is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Understand ConfigMap data types

    ConfigMaps store all values as strings, so '0' is stored as the string "0".
  2. Step 2: Effect when used as environment variable

    When mounted as environment variables, the value will be "0" (string), not a numeric zero or boolean false.
  3. Final Answer:

    The value '0' is a string and will be passed as "0", not as a number zero -> Option C
  4. Quick Check:

    ConfigMap values are strings, even '0' [OK]
Quick Trick: ConfigMap values are always strings, watch for '0' as string [OK]
Common Mistakes:
  • Assuming '0' is treated as false or ignored
  • Expecting automatic type conversion
  • Thinking ConfigMap creation fails with '0' value

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes