Merge pull request #23 from gabemontero/issue3358

get names consistent; associated doc updates based on test walkthrough
This commit is contained in:
Ben Parees 2015-07-01 15:06:58 -04:00
commit 1b284ff6a5
3 changed files with 38 additions and 31 deletions

View file

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

View file

@ -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"
}
@ -31,7 +31,7 @@
}
],
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-mongodb-example"
}
}
},
@ -39,13 +39,13 @@
"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"
}
}
},
@ -53,7 +53,7 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Keeps track of changes in the application image"
}
@ -63,7 +63,7 @@
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"name": "nodejs-mongodb-example",
"annotations": {
"description": "Defines how to build the application"
}
@ -90,7 +90,7 @@
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "nodejs-example:latest"
"name": "nodejs-mongodb-example:latest"
}
},
"triggers": [
@ -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"
}
@ -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"
}
}
},
@ -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
@ -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",

View file

@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-example",
"annotations": {
"description": "Exposes and load balances the application pods"
}
@ -31,7 +31,7 @@
}
],
"selector": {
"name": "nodejs-frontend"
"name": "nodejs-example"
}
}
},
@ -39,13 +39,13 @@
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-route"
"name": "nodejs-example"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "nodejs-frontend"
"name": "nodejs-example"
}
}
},
@ -110,7 +110,7 @@
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"name": "nodejs-example",
"annotations": {
"description": "Defines how to deploy the application server"
}
@ -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": {