Merge branch 'add-mongo' into extend-narrative

This commit is contained in:
brennv 2016-04-04 16:02:59 -07:00
commit 7323896185
2 changed files with 23 additions and 9 deletions

View file

@ -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.
@ -87,6 +87,16 @@ If you're running OpenShift on a local machine, you can preview the new app by s
$ 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
This example will serve a welcome page and the current hit count as stored in a database to [http://10.2.2.2](http://10.2.2.2).

View file

@ -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": {