What is required to persist a database's data across restarts in OpenShift?

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

What is required to persist a database's data across restarts in OpenShift?

Explanation:
Persisting a database’s data across restarts requires durable storage attached to the database pod. In OpenShift this is done by creating a PersistentVolume and a PersistentVolumeClaim, then mounting the PVC into the database container. The database writes go to that mounted volume, which lives beyond the lifecycle of any single pod. If the pod restarts or is rescheduled to another node, the same PVC is reattached and the data remains available. Why the other options aren’t suitable: an emptyDir is ephemeral and disappears when the pod stops, so no data persistence across restarts. Writing data to the container’s writable layer is also ephemeral and tied to the container’s lifecycle, not a durable external store. A HostPath volume binds data to a specific node’s filesystem, which breaks portability and reliability if the pod moves to a different node or if the cluster scales. Using a PVC backed by a PV (ideally provisioned by a StorageClass) is the correct approach for persistent database storage in OpenShift.

Persisting a database’s data across restarts requires durable storage attached to the database pod. In OpenShift this is done by creating a PersistentVolume and a PersistentVolumeClaim, then mounting the PVC into the database container. The database writes go to that mounted volume, which lives beyond the lifecycle of any single pod. If the pod restarts or is rescheduled to another node, the same PVC is reattached and the data remains available.

Why the other options aren’t suitable: an emptyDir is ephemeral and disappears when the pod stops, so no data persistence across restarts. Writing data to the container’s writable layer is also ephemeral and tied to the container’s lifecycle, not a durable external store. A HostPath volume binds data to a specific node’s filesystem, which breaks portability and reliability if the pod moves to a different node or if the cluster scales. Using a PVC backed by a PV (ideally provisioned by a StorageClass) is the correct approach for persistent database storage in OpenShift.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy