Skip to content

Commit

Permalink
Merge pull request #23 from gabemontero/issue3358
Browse files Browse the repository at this point in the history
get names consistent; associated doc updates based on test walkthrough
  • Loading branch information
bparees committed Jul 1, 2015
2 parents c647e25 + 1ca4fbf commit 1b284ff
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
21 changes: 14 additions & 7 deletions README.md
Expand Up @@ -9,7 +9,7 @@ One option is to use the Docker all-in-one launch as described in the [OpenShift

### The project ###

If you don't have a project setup all ready, go ahead and take care of that
After logging in with `oc login`, if you don't have a project setup all ready, go ahead and take care of that

$ oc new-project nodejs-echo --display-name="nodejs" --description="Sample Node.js app"

Expand All @@ -19,25 +19,27 @@ That's it, project has been created. Though it would probably be good to set yo

### The app ###

Now let's pull in the app source code from [GitHub repo](https://github.com/openshift/nodejs-ex) (fork if you like)
Now let's pull in the app source code from [GitHub repo](https://github.com/openshift/nodejs-ex) (fork if you like).

#### create ####

$ oc new-app https://github.com/openshift/nodejs-ex -l name=myapp
That should be it, `new-app` will take care of creating the right build configuration, deployment configuration and service definition. Next you'll be able to kick off the build. The -l flag will apply a label of "name=myapp" to all the resources created by new-app, for easy management later.
That should be it, this form of `new-app` will locate an appropriate image on DockerHub, create an ImageStream for that image, and then create the right build configuration, deployment configuration and service definition. Next you'll be able to kick off the build, though new-app will kick off a build once all required dependencies are confirmed. The -l flag will apply a label of "name=myapp" to all the resources created by new-app, for easy management later.

Note, you can follow along with the web console (located at https://ip-address:8443/console) to see what new resources have been created and watch the progress of the build and deployment.

#### build ####

$ oc start-build nodejs --follow
If the build is not started (you can check by running "oc get builds"), start one and stream the logs with:

You can alternatively leave off `--follow` and use `oc build-logs nodejs-n` where n is the number of the build (output of start-build).
$ oc start-build nodejs-ex --follow

You can alternatively leave off `--follow` and use `oc build-logs nodejs-ex-n` where n is the number of the build to track the output of the build.

#### deploy ####

happens automatically, to monitor its status either watch the web console or `oc get pods` to see when the pod is up. Another helpful command is
Deployment happens automatically once the new application image is available. To monitor its status either watch the web console or execute `oc get pods` to see when the pod is up. Another helpful command is

$ oc status

Expand All @@ -47,7 +49,7 @@ This will help indicate what IP address the service is running, the default port

Determine the service ip for the application by running

$ oc svc
$ oc get svc

Run/test your app by browsing to

Expand All @@ -63,6 +65,11 @@ Assuming you used the URL of your own forked report, we can easily push changes

To remove all the resources with the label "name=myapp".

###Debugging Unexpected Failures

Review some of the common tips and suggestions [here](https://github.com/openshift/origin/blob/master/docs/debugging-openshift.md).


### Web UI ###

To run this example from the Web UI, you can same steps following done on the CLI as defined above by [The project](#the-project). Here's a video showing it in motion:
Expand Down
32 changes: 16 additions & 16 deletions openshift/templates/nodejs-mongodb.json
Expand Up @@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Exposes and load balances the application pods"
}
Expand All @@ -31,29 +31,29 @@
}
],
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-mongodb-example"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-route"
"name": "nodejs-mongodb-example"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "nodejs-frontend"
"name": "nodejs-mongodb-example"
}
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Keeps track of changes in the application image"
}
Expand All @@ -63,7 +63,7 @@
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Defines how to build the application"
}
Expand All @@ -90,7 +90,7 @@
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "nodejs-example:latest"
"name": "nodejs-mongodb-example:latest"
}
},
"triggers": [
Expand All @@ -110,7 +110,7 @@
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Defines how to deploy the application server"
}
Expand All @@ -125,11 +125,11 @@
"imageChangeParams": {
"automatic": true,
"containerNames": [
"nodejs-example"
"nodejs-mongodb-example"
],
"from": {
"kind": "ImageStreamTag",
"name": "nodejs-example:latest"
"name": "nodejs-mongodb-example:latest"
}
}
},
Expand All @@ -139,20 +139,20 @@
],
"replicas": 1,
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-mongodb-example"
},
"template": {
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-mongodb-example",
"labels": {
"name": "nodejs-frontend"
"name": "nodejs-mongodb-example"
}
},
"spec": {
"containers": [
{
"name": "nodejs-example",
"image": "nodejs-example",
"name": "nodejs-mongodb-example",
"image": "nodejs-mongodb-example",
"ports": [
{
"containerPort": 8080
Expand Down Expand Up @@ -289,7 +289,7 @@
{
"name": "APPLICATION_DOMAIN",
"description": "The exposed hostname that will route to the Node.js service",
"value": "nodejs-example.openshiftapps.com"
"value": "nodejs-mongodb-example.openshiftapps.com"
},
{
"name": "GITHUB_WEBHOOK_SECRET",
Expand Down
16 changes: 8 additions & 8 deletions openshift/templates/nodejs.json
Expand Up @@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-example",
"annotations": {
"description": "Exposes and load balances the application pods"
}
Expand All @@ -31,21 +31,21 @@
}
],
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-example"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-route"
"name": "nodejs-example"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "nodejs-frontend"
"name": "nodejs-example"
}
}
},
Expand Down Expand Up @@ -110,7 +110,7 @@
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-example",
"annotations": {
"description": "Defines how to deploy the application server"
}
Expand Down Expand Up @@ -139,13 +139,13 @@
],
"replicas": 1,
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-example"
},
"template": {
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-example",
"labels": {
"name": "nodejs-frontend"
"name": "nodejs-example"
}
},
"spec": {
Expand Down

0 comments on commit 1b284ff

Please sign in to comment.