You have a Pod that needs access to a database configuration file (db-config.yaml) containing database endpoints, ports, and connection pool settings, and a database password. What is the Kubernetes best practice for storing and exposing these configurations to the Pod?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Store db-config.yaml in a ConfigMap and the password in a Secret, and mount both as volumes or expose them as environment variables in the Pod

General application configurations like connection strings, ports, and connection pool properties are non-sensitive and should be stored in ConfigMaps. Sensitive data like password...

Real Exam ScenarioKubernetes Core

You have a Pod that needs access to a database configuration file (db-config.yaml) containing database endpoints, ports, and connection pool settings, and a database password. What is the Kubernetes best practice for storing and exposing these configurations to the Pod?

✓ Correct Answer & ExplanationKubernetes Core

Correct Answer

Store db-config.yaml in a ConfigMap and the password in a Secret, and mount both as volumes or expose them as environment variables in the Pod

Why This Answer Is Correct

General application configurations like connection strings, ports, and connection pool properties are non-sensitive and should be stored in ConfigMaps. Sensitive data like passwords or private keys should be stored in Secrets.

📚 What This Question Tests

This question evaluates your knowledge of Kubernetes Core — a core concept tested in cloud certification exams. Understanding Kubernetes Core is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.