From 53a510899aa171c2f898c1424673e3bdb9986b39 Mon Sep 17 00:00:00 2001 From: brennv Date: Mon, 4 Apr 2016 14:46:02 -0700 Subject: [PATCH 1/3] Adding mongodb service (Hmmm, now restart everything and it automagically works? Or add the mongodb url to the nodejs pod some how?) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 9f6c5ff..927b304 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,16 @@ As of OpenShift v3.1 routes can be configured in the web console or via CLI. Usi If you're running OpenShift on a local machine, you can preview the new app by setting a local route like: $ oc expose service/nodejs-ex --hostname=10.2.2.2 + +#### database + +You may have noticed the "Page view count" reads "No database configured". Let's fix that by adding a MongoDB pod: + + $ oc new-app -e \ + $ MONGODB_USER=admin,MONGODB_DATABASE=mongo_db,MONGODB_PASSWORD=secret,MONGODB_ADMIN_PASSWORD=super-secret \ + $ centos/mongodb-26-centos7 + +(Database work to be continued...) #### enjoy From d9c8c2e5e0e9f433f2ccfec5b2a4e103004a94b0 Mon Sep 17 00:00:00 2001 From: brennv Date: Mon, 4 Apr 2016 14:49:43 -0700 Subject: [PATCH 2/3] Formatting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 927b304..647e507 100644 --- a/README.md +++ b/README.md @@ -7,19 +7,19 @@ This example will serve a welcome page and the current hit count as stored in a There are four methods to get started with OpenShift v3: running a virtual machine with Vagrant, starting a Docker continer, downloading the binary, or running an Ansible playbook. -Vagrant into a Virtual Machine +#### Vagrant into a Virtual Machine One option is to use the Vagrant all-in-one launch as described in the [OpenShift Origin All-In-One Virtual Machine](https://www.openshift.org/vm/). This option works on Mac, Windows and Linux, but requires that you install [Vagrant](https://www.vagrantup.com/downloads.html) running [VirtualBox](https://www.virtualbox.org/wiki/Downloads). -Running a Docker Container +#### Run a Docker Container Another option is running the OpenShift Origin Docker container image from [Docker Hub](https://hub.docker.com/r/openshift/origin/) launch as described in the [Getting Started for Administrators](https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container). This method is supported on Fedora, CentOS, and Red Hat Enterprise Linux (RHEL) hosts only. -Downloading the Binary +#### Download the Binary Red Hat periodically publishes OpenShift Origin Server binaries for Linux, which you can download on the OpenShift Origin GitHub [Release](https://github.com/openshift/origin/releases) page. Instructions on how to install and launch the Openshift Origin Server from binary are described in [Getting Started for Administrators](https://docs.openshift.org/latest/getting_started/administrators.html#downloading-the-binary). -Running Ansible +#### Run Ansible Outlined as the [Advanced Intallation](https://docs.openshift.org/latest/install_config/install/advanced_install.html) method for poduction environments, OpenShift Origin is also installable via Ansible playbook made avaialble on the GitHub [openShift-ansible](https://github.com/openshift/openshift-ansible) repo. From dd22958804f2913b588e13e8d397ffea401ca246 Mon Sep 17 00:00:00 2001 From: brennv Date: Mon, 4 Apr 2016 16:01:48 -0700 Subject: [PATCH 3/3] Testing mongoldb config --- openshift/templates/nodejs.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/openshift/templates/nodejs.json b/openshift/templates/nodejs.json index 82df67c..61eda27 100644 --- a/openshift/templates/nodejs.json +++ b/openshift/templates/nodejs.json @@ -191,23 +191,27 @@ "env": [ { "name": "DATABASE_SERVICE_NAME", - "value": "${DATABASE_SERVICE_NAME}" + "value": "mongodb-26-centos7" }, { "name": "MONGODB_USER", - "value": "${MONGODB_USER}" + "value": "admin" }, { "name": "MONGODB_PASSWORD", - "value": "${MONGODB_PASSWORD}" + "value": "secret" }, { "name": "MONGODB_DATABASE", - "value": "${MONGODB_DATABASE}" + "value": "mongo_db" }, { "name": "MONGODB_ADMIN_PASSWORD", - "value": "${MONGODB_ADMIN_PASSWORD}" + "value": "super-secret" + }, + { + "name": "MONGODB_URL", + "value": "172.30.27.142:27017" } ], "resources": {