Correct Answer: Configure an initContainer in the Pod spec that runs a shell loop checking connection to config-db and exits only on success
Init containers run to completion before the main application containers start. Running a connection-check loop in an init container guarantees that the main application will not s...
Correct Answer
Configure an initContainer in the Pod spec that runs a shell loop checking connection to config-db and exits only on success
Why This Answer Is Correct
Init containers run to completion before the main application containers start. Running a connection-check loop in an init container guarantees that the main application will not start until the dependent database service is ready and reachable.
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.
To safely isolate resources (like Deployments and Services) belonging to different teams on the same cluster, you should use:
A developer wants to run a multi-container pod where a main application container writes files to a shared directory, and a secondary sidecar container reads and processes those files in real-time. How should the storage be shared between these two containers in the same Pod?
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?
A security audit reveals that default service account tokens are being automatically mounted in all Pods, posing a credential exposure risk. How can you configure a Pod spec to prevent the automatic mounting of the default ServiceAccount token?