2021-10-27 12:56:29 -04:00
// Module included in the following assemblies:
//
2025-03-05 12:04:17 -05:00
// * tutorials/dev-app-cli.adoc
2021-10-27 12:56:29 -04:00
2023-10-30 10:13:25 -04:00
:_mod-docs-content-type: PROCEDURE
2021-10-27 12:56:29 -04:00
[id="getting-started-cli-connecting-database_{context}"]
2025-03-05 12:04:17 -05:00
= Deploying the database application
2021-10-27 12:56:29 -04:00
2025-12-09 16:38:41 -05:00
[role="_abstract"]
Deploy a MongoDB database application to contain the information that your application requires. For this tutorial, you will deploy a database application called `mongodb-nationalparks` that holds the national park location information.
2021-10-27 12:56:29 -04:00
.Prerequisites
2025-03-05 12:04:17 -05:00
* You have deployed the `parksmap` front-end application.
* You have deployed the `nationalparks` back-end application.
2021-10-27 12:56:29 -04:00
.Procedure
2025-03-05 12:04:17 -05:00
* Deploy the `mongodb-nationalparks` database application by running the following command:
2021-10-27 12:56:29 -04:00
+
[source,terminal]
----
2025-03-05 12:04:17 -05:00
$ oc new-app registry.redhat.io/rhmap47/mongodb --name mongodb-nationalparks -e MONGODB_USER=mongodb -e MONGODB_PASSWORD=mongodb -e MONGODB_DATABASE=mongodb -e MONGODB_ADMIN_PASSWORD=mongodb -l 'app.kubernetes.io/part-of=national-parks-app,app.kubernetes.io/name=mongodb'
2021-10-27 12:56:29 -04:00
----
+
.Example output
2025-03-05 12:04:17 -05:00
[source,text]
2021-10-27 12:56:29 -04:00
----
2025-03-05 12:04:17 -05:00
--> Found container image 7a61087 (12 days old) from quay.io for "quay.io/mongodb/mongodb-enterprise-server"
2021-10-27 12:56:29 -04:00
2025-03-05 12:04:17 -05:00
* An image stream tag will be created as "mongodb-nationalparks:latest" that will track this image
2021-10-27 12:56:29 -04:00
--> Creating resources with label app.kubernetes.io/name=mongodb,app.kubernetes.io/part-of=national-parks-app ...
imagestream.image.openshift.io "mongodb-nationalparks" created
deployment.apps "mongodb-nationalparks" created
service "mongodb-nationalparks" created
--> Success
2025-03-05 12:04:17 -05:00
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose service/mongodb-nationalparks'
Run 'oc status' to view your app.
2021-10-27 12:56:29 -04:00
----