Skip to content

Commit d80c610

Browse files
committed
improve readme examples
1 parent 29a881a commit d80c610

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ This repo contains an empty Java Spring Boot project created by https://start.sp
55
I added a simple Controller Class (src/main/java/com/arska/SpringdemoController.java) to output "Hello!" when accessing the application root instead of an error.
66

77
The build configuration in pom.xml outputs a WAR called ROOT.war that will be automatically deployed by the OpenShift 3 Source-to-Image (s2i) process for JBoss.
8-
You can run this on OpenShift (e.g. http://appuio.ch) using the Web-GUI ("Add to project", select "JBoss Web Server 3.1 Apache Tomcat 8" Template, enter a name (e.g. springdemo) and GIT URL (e.g. https://github.com/appuio/springdemo.git) and "create") or CLI:
8+
You can run this on OpenShift (e.g. http://appuio.ch) using the Web-GUI ("Add to project", select "JBoss Web Server 3.1 Apache Tomcat 8" Template, enter a name (e.g. springdemo) and GIT URL (e.g. https://github.com/appuio/springdemo.git) and "create") or deploy via the CLI:
99
```
10-
$ oc new-app openshift/jboss-webserver31-tomcat8-openshift:1.1~https://github.com/appuio/springdemo.git
11-
$ oc expose service springdemo
10+
oc new-app openshift/jboss-webserver31-tomcat8-openshift:1.1~https://github.com/appuio/springdemo.git
11+
oc patch bc/springdemo -p '{"spec":{"resources":{"limits":{"memory":"500Mi"}}}}'
12+
oc patch dc/springdemo -p '{"spec":{"template":{"spec":{"containers":[{"name":"springdemo","resources":{"limits":{"memory": "500Mi"}}}]}}}}'
13+
oc start-build springdemo
14+
oc expose service springdemo
1215
```
1316

14-
You might need to adjust RAM ressource limits as the 256MB is a bit tight for JBoss.
17+
As you can see we need to adjust the RAM ressource limit for the build and deployment as the default 256MB is too tight for JBoss.
1518

16-
This repo also contains an openshift template springdemo-template.json that you can use to instantiate the project, either manually though copy-pasting it to the Web-GUI ("Add to project", "Import YAML / JSON") or through the CLI:
19+
This repo also contains an openshift template springdemo-template.json that you can use to instantiate the project including proper limits and health checks, either manually though copy-pasting it to the Web-GUI ("Add to project", "Import YAML / JSON") or through the CLI:
1720
```
18-
$ oc new-app -f springdemo-template.json
21+
oc new-app -f https://raw.githubusercontent.com/appuio/springdemo/master/springdemo-template.json -p APPNAME=springdemo
1922
```
2023

21-
Note that due to a race condition when instantiating the template (https://github.com/openshift/origin/issues/4518) the first build run can fail at pushing the resuling container ("Error pushing to registry: Authentication is required"), just start a new build in the Web-GUI oder CLI (oc new-build springdemo).
24+
Note that due to a race condition when instantiating the template (https://github.com/openshift/origin/issues/4518) the first build run might fail at pushing the resuling container ("Error pushing to registry: Authentication is required"), just start a new build in the Web-GUI oder CLI (oc new-build springdemo).
2225

23-
When opening the app you should see "Hello!".
26+
When opening the app URL you should see "Hello!".
2427

25-
You can check out the healthcheck-page at /health, the name of the pod at /env/jboss.node.name and other spring mappings at /mappings
28+
You can check out the healthcheck-page at /actuator/health
2629

2730
You can clean everything up with
2831
```

springdemo-template.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@
104104
"name": "${APPNAME}:latest"
105105
}
106106
},
107-
"resources": {
108-
"limits": {
109-
"memory": "1Gi"
110-
}
111-
}
107+
"resources": {
108+
"limits": {
109+
"memory": "500Mi"
110+
}
111+
}
112112
}
113113
}, {
114114
"kind": "DeploymentConfig",
@@ -181,9 +181,9 @@
181181
"terminationMessagePath": "/dev/termination-log",
182182
"imagePullPolicy": "Always",
183183
"resources": {
184-
"limits": {
185-
"memory": "500Mi"
186-
}
184+
"limits": {
185+
"memory": "500Mi"
186+
}
187187
}
188188
}],
189189
"restartPolicy": "Always",

0 commit comments

Comments
 (0)