|
| 1 | +# Microservices on OpenShift |
| 2 | + |
| 3 | +This directory contains the different microservices running on top of OpenShift developed in the book. In order of appearance: |
| 4 | + |
| 5 | +* [Hello Microservice](hello-microservice-openshift) |
| 6 | +* [Hello Consumer Microservice](hello-microservice-consumer-openshift) |
| 7 | +* [Hello Microservice with Health Check](hello-microservice-openshift-health-checks) |
| 8 | +* [Hello Consumer Microservice with Circuit Breaker](hello-microservice-consumer-openshift-circuit-breaker) |
| 9 | + |
| 10 | +Each project is built with Apache Maven: |
| 11 | + |
| 12 | +``` |
| 13 | +cd $DIRECTORY |
| 14 | +mvn clean package |
| 15 | +``` |
| 16 | + |
| 17 | +Each project contains a `README` with running instructions. |
| 18 | + |
| 19 | + |
| 20 | +You need access to an OpenShift v3.x instance to run them. Either use [OpenShift Online](https://www.openshift.com/devpreview/) of []MiniShift](https://github.com/minishift/minishift). |
| 21 | + |
| 22 | +Once running, login using the `oc` command line. For MiniShift, use: |
| 23 | + |
| 24 | +``` |
| 25 | +oc login https://192.168.64.12:8443 -u developer -p developer |
| 26 | +``` |
| 27 | + |
| 28 | +Also, create a new project: |
| 29 | + |
| 30 | +``` |
| 31 | +oc new-project reactive-microservices |
| 32 | +oc policy add-role-to-user admin developer -n reactive-microservices |
| 33 | +oc policy add-role-to-user view -n reactive-microservices -z default |
| 34 | +``` |
| 35 | + |
| 36 | +NOTE: on OpenShift Online you may not be able to create a new project (as you have a limited number of projects). In this context, run: |
| 37 | + |
| 38 | +``` |
| 39 | +oc project -q # Print the name of the current project |
| 40 | +oc policy add-role-to-user admin developer -n $PROJECT_NAME |
| 41 | +oc policy add-role-to-user view -n $PROJECT_NAME -z default |
| 42 | +``` |
| 43 | + |
| 44 | +Replace `$PROJECT_NAME` by the name printed by the first command. |
| 45 | + |
| 46 | +Then, open the OpenShift console: |
| 47 | + |
| 48 | +* OpenShift Online - https://console.preview.openshift.com/console/ |
| 49 | +* MiniShift - https://192.168.64.12:8443/console/ (`developer/developer`) |
| 50 | + |
| 51 | + |
| 52 | + |
0 commit comments