OpenShift Container Platform provides a template to make
creating a new database service easy. The template provides parameter fields to
define all the mandatory environment variables (user, password, database name,
etc) with predefined defaults including auto-generation of password values. It
will also define both a
configuration and a
There are two templates available:
mongodb-ephemeral is for development/testing purposes only because it uses
ephemeral storage for the database content. This means that if the database
pod is restarted for any reason, such as the pod being moved to another node
or the deployment configuration being updated and triggering a redeploy, all
data will be lost.
mongodb-persistent uses a persistent volume store for the database data
which means the data will survive a pod restart.
Using persistent volumes requires a persistent volume pool be defined in the
OpenShift Container Platform deployment.
Cluster administrator instructions for setting up the pool are located
You can find instructions for instantiating templates by following these
Once you have instantiated the service, you can copy the user name, password,
and database name environment variables into a deployment configuration for
another component that intends to access the database. That component can then
access the database via the service that was defined.