Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

If you want to access a database service in OpenShift from an application, which approach is recommended?

In OpenShift, applications connect to a database by using the database service’s DNS name and credentials stored in a Secret. This approach leverages in-cluster service discovery so the app can reach the database through a stable endpoint that remains valid even if pod IPs or database pods change. Credentials belong in a Secret, then are injected into the application as environment variables or mounted as files, keeping sensitive data out of code and non-secret configuration. Hard-coding the host ties the app to a fixed, brittle endpoint; using external IPs is similarly fragile and defeats internal service discovery; and ConfigMaps are not designed for secrets, so they risk exposure of passwords. Using the service DNS plus Secrets provides a secure, resilient, and maintainable connection method.

In OpenShift, applications connect to a database by using the database service’s DNS name and credentials stored in a Secret. This approach leverages in-cluster service discovery so the app can reach the database through a stable endpoint that remains valid even if pod IPs or database pods change. Credentials belong in a Secret, then are injected into the application as environment variables or mounted as files, keeping sensitive data out of code and non-secret configuration. Hard-coding the host ties the app to a fixed, brittle endpoint; using external IPs is similarly fragile and defeats internal service discovery; and ConfigMaps are not designed for secrets, so they risk exposure of passwords. Using the service DNS plus Secrets provides a secure, resilient, and maintainable connection method.