Skip to content

Commit 89122e0

Browse files
committed
move to consistent name; README corrections borrowed from other examples and through specific walkthrough
1 parent 92d3570 commit 89122e0

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TLDR: OpenShift can generate and expose environment variables to your applicatio
2727
###Development mode
2828
When you develop your Rails application in OpenShift, you can also enable the 'development' environment by setting the RAILS_ENV environment variable for your deploymentConfiguration, using the `oc` client, like:
2929

30-
$ oc env dc/frontend RAILS_ENV=development
30+
$ oc env dc/rails-postgresql-example RAILS_ENV=development
3131

3232

3333
If you do so, OpenShift will run your application under 'development' mode. In development mode, your application will:
@@ -37,57 +37,57 @@ If you do so, OpenShift will run your application under 'development' mode. In d
3737
Development environment can help you debug problems in your application in the same way as you do when developing on your local machine. However, we strongly advise you to not run your application in this mode in production.
3838

3939
###Installation:
40-
These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available [here](http://docs.openshift.org/latest/admin_guide/install/first_steps.html)
40+
These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available [here](http://docs.openshift.org/latest/admin_guide/install/first_steps.html). Instructions for installing the default ImageStreams are available [here](http://docs.openshift.org/latest/admin_guide/install/first_steps.html). If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace.
4141

4242
1. Fork a copy of [rails-ex](https://github.com/openshift/rails-ex)
4343
2. Clone your repository to your development machine and cd to the repository directory
4444
3. Add a Ruby application from the rails template:
4545

46-
$ oc new-app openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/yourusername/rails-ex
46+
$ oc new-app openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/< yourusername >/rails-ex
4747

48-
4. Note that creating from a template will automatically start a new build. Watch your build progress:
48+
4. Depending on the state of your system, and whether additional items need to be downloaded, it may take around a minute for your build to be started automatically. If you do not want to wait, run
4949

50-
$ oc build-logs rails-example-1
50+
$ oc start-build rails-postgresql-example
5151

52-
5. Wait for frontend pods to start up (this can take a few minutes):
52+
5. Once the build is running, watch your build progress
53+
54+
$ oc build-logs rails-postgresql-example-1
55+
56+
6. Wait for rails-postgresql-example pods to start up (this can take a few minutes):
5357

5458
$ oc get pods -w
5559

5660

5761
Sample output:
5862

5963
NAME READY REASON RESTARTS AGE
60-
rails-example-1-build 1/1 Running 0 2m
61-
NAME READY REASON RESTARTS AGE
62-
rails-frontend-1-deploy 0/1 Pending 0 0s
63-
rails-frontend-1-deploy 0/1 Running 0 2s
64-
rails-frontend-1-prehook 0/1 Pending 0 0s
65-
rails-frontend-1-deploy 1/1 Running 0 3s
66-
rails-example-1-build 0/1 ExitCode:0 0 2m
67-
rails-frontend-1-prehook 0/1 Running 0 6s
68-
rails-frontend-1-prehook 0/1 ExitCode:0 0 10s
69-
rails-frontend-1-xlqrp 0/1 Pending 0 0s
70-
rails-frontend-1-xlqrp 0/1 Running 0 1s
71-
rails-frontend-1-xlqrp 1/1 Running 0 11s
72-
rails-frontend-1-deploy 0/1 ExitCode:0 0 24s
73-
rails-frontend-1-prehook 0/1 ExitCode:0 0 22s
64+
postgresql-1-vk6ny 1/1 Running 0 4m
65+
rails-postgresql-example-1-build 0/1 ExitCode:0 0 3m
66+
rails-postgresql-example-1-deploy 1/1 Running 0 34s
67+
rails-postgresql-example-1-prehook 0/1 ExitCode:0 0 32s
7468

7569

7670

77-
6. Check the IP and port the frontend service is running on:
71+
7. Check the IP and port the rails-postgresql-example service is running on:
7872

7973
$ oc get svc
8074

8175

8276
Sample output:
8377

8478
NAME LABELS SELECTOR IP(S) PORT(S)
85-
rails-frontend template=rails-example name=rails-frontend 172.30.161.15 8080/TCP
79+
postgresql template=rails-postgresql-example name=postgresql 172.30.197.40 5432/TCP
80+
rails-postgresql-example template=rails-postgresql-example name=rails-postgresql-example 172.30.205.117 8080/TCP
81+
8682

87-
In this case, the IP for frontend is 172.30.161.15 and it is on port 8080.
83+
In this case, the IP for rails-postgresql-example rails-postgresql-example is 172.30.205.117 and it is on port 8080.
8884
*Note*: you can also get this information from the web console.
8985

9086

87+
###Debugging Unexpected Failures
88+
89+
Review some of the common tips and suggestions [here](https://github.com/openshift/origin/blob/master/docs/debugging-openshift.md).
90+
9191
###Adding Webhooks and Making Code Changes
9292
Since OpenShift V3 does not provide a git repository out of the box, you can configure your github repository to make a webhook call whenever you push your code.
9393

openshift/templates/rails-postgresql.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"kind": "Service",
1818
"apiVersion": "v1",
1919
"metadata": {
20-
"name": "rails-frontend",
20+
"name": "rails-postgresql-example",
2121
"annotations": {
2222
"description": "Exposes and load balances the application pods"
2323
}
@@ -31,29 +31,29 @@
3131
}
3232
],
3333
"selector": {
34-
"name": "rails-frontend"
34+
"name": "rails-postgresql-example"
3535
}
3636
}
3737
},
3838
{
3939
"kind": "Route",
4040
"apiVersion": "v1",
4141
"metadata": {
42-
"name": "rails-route"
42+
"name": "rails-postgresql-example"
4343
},
4444
"spec": {
4545
"host": "${APPLICATION_DOMAIN}",
4646
"to": {
4747
"kind": "Service",
48-
"name": "rails-frontend"
48+
"name": "rails-postgresql-example"
4949
}
5050
}
5151
},
5252
{
5353
"kind": "ImageStream",
5454
"apiVersion": "v1",
5555
"metadata": {
56-
"name": "rails-example",
56+
"name": "rails-postgresql-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": "rails-example",
66+
"name": "rails-postgresql-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": "rails-example:latest"
93+
"name": "rails-postgresql-example:latest"
9494
}
9595
},
9696
"triggers": [
@@ -110,7 +110,7 @@
110110
"kind": "DeploymentConfig",
111111
"apiVersion": "v1",
112112
"metadata": {
113-
"name": "rails-frontend",
113+
"name": "rails-postgresql-example",
114114
"annotations": {
115115
"description": "Defines how to deploy the application server"
116116
}
@@ -125,7 +125,7 @@
125125
"command": [
126126
"./migrate-database.sh"
127127
],
128-
"containerName": "rails-example"
128+
"containerName": "rails-postgresql-example"
129129
}
130130
}
131131
}
@@ -136,11 +136,11 @@
136136
"imageChangeParams": {
137137
"automatic": true,
138138
"containerNames": [
139-
"rails-example"
139+
"rails-postgresql-example"
140140
],
141141
"from": {
142142
"kind": "ImageStreamTag",
143-
"name": "rails-example:latest"
143+
"name": "rails-postgresql-example:latest"
144144
}
145145
}
146146
},
@@ -150,20 +150,20 @@
150150
],
151151
"replicas": 1,
152152
"selector": {
153-
"name": "rails-frontend"
153+
"name": "rails-postgresql-example"
154154
},
155155
"template": {
156156
"metadata": {
157-
"name": "rails-frontend",
157+
"name": "rails-postgresql-example",
158158
"labels": {
159-
"name": "rails-frontend"
159+
"name": "rails-postgresql-example"
160160
}
161161
},
162162
"spec": {
163163
"containers": [
164164
{
165-
"name": "rails-example",
166-
"image": "rails-example",
165+
"name": "rails-postgresql-example",
166+
"image": "rails-postgresql-example",
167167
"ports": [
168168
{
169169
"containerPort": 8080
@@ -328,7 +328,7 @@
328328
{
329329
"name": "APPLICATION_DOMAIN",
330330
"description": "The exposed hostname that will route to the Rails service",
331-
"value": "rails-example.openshiftapps.com"
331+
"value": "rails-postgresql-example.openshiftapps.com"
332332
},
333333
{
334334
"name": "GITHUB_WEBHOOK_SECRET",

0 commit comments

Comments
 (0)