1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/getting-started-web-console-connecting-a-database.adoc
2023-10-30 10:13:25 -04:00

43 lines
1.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * getting-started/openshift-web-console.adoc
:_mod-docs-content-type: PROCEDURE
[id="getting-started-web-console-connecting-database_{context}"]
= Connecting to a database
Deploy and connect a MongoDB database where the `national-parks-app` application stores location information.
Once you mark the `national-parks-app` application as a backend for the map visualization tool, `parksmap` deployment uses the {product-title} discover mechanism to display the map automatically.
.Prerequisites
* You are logged in to the {product-title} web console.
* You are in the *Developer* perspective.
* You have a deployed image.
.Procedure
. From the *+Add* view in the *Developer* perspective, click *Container images* to open a dialog.
. In the *Image Name* field, enter `quay.io/centos7/mongodb-36-centos7`.
. In the *Runtime icon* field, search for `mongodb`.
. Scroll down to the *General* section.
. Ensure that you have the current values for the following:
.. Application: `national-parks-app`
.. Name: `mongodb-nationalparks`
. Select *Deployment* as the *Resource*.
. Unselect the checkbox next to *Create route to the application*.
. In the *Advanced Options* section, click *Deployment* to add environment variables to add the following environment variables:
+
.Environment variable names and values
[cols="1,1"]
|===
|Name |Value
|`MONGODB_USER`|`mongodb`
|`MONGODB_PASSWORD`|`mongodb`
|`MONGODB_DATABASE`|`mongodb`
|`MONGODB_ADMIN_PASSWORD`|`mongodb`
|===
. Click *Create*.