Skip to content

Commit 1b284ff

Browse files
committed
Merge pull request sclorg#23 from gabemontero/issue3358
get names consistent; associated doc updates based on test walkthrough
2 parents c647e25 + 1ca4fbf commit 1b284ff

File tree

3 files changed

+38
-31
lines changed

3 files changed

+38
-31
lines changed

README.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ One option is to use the Docker all-in-one launch as described in the [OpenShift
99

1010
### The project ###
1111

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

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

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

2020
### The app ###
2121

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

2424
#### create ####
2525

2626
$ oc new-app https://github.com/openshift/nodejs-ex -l name=myapp
2727
28-
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.
28+
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.
2929

3030
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.
3131

3232
#### build ####
3333

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

36-
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).
36+
$ oc start-build nodejs-ex --follow
37+
38+
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.
3739

3840
#### deploy ####
3941

40-
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
42+
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
4143

4244
$ oc status
4345

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

4850
Determine the service ip for the application by running
4951

50-
$ oc svc
52+
$ oc get svc
5153

5254
Run/test your app by browsing to
5355

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

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

68+
###Debugging Unexpected Failures
69+
70+
Review some of the common tips and suggestions [here](https://github.com/openshift/origin/blob/master/docs/debugging-openshift.md).
71+
72+
6673
### Web UI ###
6774

6875
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:

openshift/templates/nodejs-mongodb.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"kind": "Service",
1818
"apiVersion": "v1",
1919
"metadata": {
20-
"name": "nodejs-frontend",
20+
"name": "nodejs-mongodb-example",
2121
"annotations": {
2222
"description": "Exposes and load balances the application pods"
2323
}
@@ -31,29 +31,29 @@
3131
}
3232
],
3333
"selector": {
34-
"name": "nodejs-frontend"
34+
"name": "nodejs-mongodb-example"
3535
}
3636
}
3737
},
3838
{
3939
"kind": "Route",
4040
"apiVersion": "v1",
4141
"metadata": {
42-
"name": "nodejs-route"
42+
"name": "nodejs-mongodb-example"
4343
},
4444
"spec": {
4545
"host": "${APPLICATION_DOMAIN}",
4646
"to": {
4747
"kind": "Service",
48-
"name": "nodejs-frontend"
48+
"name": "nodejs-mongodb-example"
4949
}
5050
}
5151
},
5252
{
5353
"kind": "ImageStream",
5454
"apiVersion": "v1",
5555
"metadata": {
56-
"name": "nodejs-example",
56+
"name": "nodejs-mongodb-example",
5757
"annotations": {
5858
"description": "Keeps track of changes in the application image"
5959
}
@@ -63,7 +63,7 @@
6363
"kind": "BuildConfig",
6464
"apiVersion": "v1",
6565
"metadata": {
66-
"name": "nodejs-example",
66+
"name": "nodejs-mongodb-example",
6767
"annotations": {
6868
"description": "Defines how to build the application"
6969
}
@@ -90,7 +90,7 @@
9090
"output": {
9191
"to": {
9292
"kind": "ImageStreamTag",
93-
"name": "nodejs-example:latest"
93+
"name": "nodejs-mongodb-example:latest"
9494
}
9595
},
9696
"triggers": [
@@ -110,7 +110,7 @@
110110
"kind": "DeploymentConfig",
111111
"apiVersion": "v1",
112112
"metadata": {
113-
"name": "nodejs-frontend",
113+
"name": "nodejs-mongodb-example",
114114
"annotations": {
115115
"description": "Defines how to deploy the application server"
116116
}
@@ -125,11 +125,11 @@
125125
"imageChangeParams": {
126126
"automatic": true,
127127
"containerNames": [
128-
"nodejs-example"
128+
"nodejs-mongodb-example"
129129
],
130130
"from": {
131131
"kind": "ImageStreamTag",
132-
"name": "nodejs-example:latest"
132+
"name": "nodejs-mongodb-example:latest"
133133
}
134134
}
135135
},
@@ -139,20 +139,20 @@
139139
],
140140
"replicas": 1,
141141
"selector": {
142-
"name": "nodejs-frontend"
142+
"name": "nodejs-mongodb-example"
143143
},
144144
"template": {
145145
"metadata": {
146-
"name": "nodejs-frontend",
146+
"name": "nodejs-mongodb-example",
147147
"labels": {
148-
"name": "nodejs-frontend"
148+
"name": "nodejs-mongodb-example"
149149
}
150150
},
151151
"spec": {
152152
"containers": [
153153
{
154-
"name": "nodejs-example",
155-
"image": "nodejs-example",
154+
"name": "nodejs-mongodb-example",
155+
"image": "nodejs-mongodb-example",
156156
"ports": [
157157
{
158158
"containerPort": 8080
@@ -289,7 +289,7 @@
289289
{
290290
"name": "APPLICATION_DOMAIN",
291291
"description": "The exposed hostname that will route to the Node.js service",
292-
"value": "nodejs-example.openshiftapps.com"
292+
"value": "nodejs-mongodb-example.openshiftapps.com"
293293
},
294294
{
295295
"name": "GITHUB_WEBHOOK_SECRET",

openshift/templates/nodejs.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"kind": "Service",
1818
"apiVersion": "v1",
1919
"metadata": {
20-
"name": "nodejs-frontend",
20+
"name": "nodejs-example",
2121
"annotations": {
2222
"description": "Exposes and load balances the application pods"
2323
}
@@ -31,21 +31,21 @@
3131
}
3232
],
3333
"selector": {
34-
"name": "nodejs-frontend"
34+
"name": "nodejs-example"
3535
}
3636
}
3737
},
3838
{
3939
"kind": "Route",
4040
"apiVersion": "v1",
4141
"metadata": {
42-
"name": "nodejs-route"
42+
"name": "nodejs-example"
4343
},
4444
"spec": {
4545
"host": "${APPLICATION_DOMAIN}",
4646
"to": {
4747
"kind": "Service",
48-
"name": "nodejs-frontend"
48+
"name": "nodejs-example"
4949
}
5050
}
5151
},
@@ -110,7 +110,7 @@
110110
"kind": "DeploymentConfig",
111111
"apiVersion": "v1",
112112
"metadata": {
113-
"name": "nodejs-frontend",
113+
"name": "nodejs-example",
114114
"annotations": {
115115
"description": "Defines how to deploy the application server"
116116
}
@@ -139,13 +139,13 @@
139139
],
140140
"replicas": 1,
141141
"selector": {
142-
"name": "nodejs-frontend"
142+
"name": "nodejs-example"
143143
},
144144
"template": {
145145
"metadata": {
146-
"name": "nodejs-frontend",
146+
"name": "nodejs-example",
147147
"labels": {
148-
"name": "nodejs-frontend"
148+
"name": "nodejs-example"
149149
}
150150
},
151151
"spec": {

0 commit comments

Comments
 (0)