Chapter 2. Reference Architecture Environment
This reference architecture builds and deploys a distributed microservice architecture on top of OpenShift. The application architecture is based on the design laid out and explained in depth in the reference architecture document on EAP Microservice Architecture, implemented on OpenShift in previous reference architecture work.
The starting point for this project includes six services, where two of these are database services based on the standard and supported MySQL image. The remaining four images in the original reference architecture are based on the supported JBoss EAP xPaaS image and rely on the Source to Image (S2I) functionality to build and deploy. The EAP images are customized for two of these services to add a MySQL datasource.
Figure 2.1. Service Diagram, only Java EE implementation

The services in the original implementation are loosely coupled, relying only on REST web service calls to communicate with one another. As a result, any of them can be replaced with a new implementation, as long as the API and behavior is not changed.
All OpenShift services can be configured and scaled with the desired number of replicas. In a default OpenShift installation, the nodes are the only targets for service deployment. However, the master hosts can also be configured as schedulable in order to host service replicas.
The presentation service is the only entry point to the application and serves HTML to the client browser over HTTP. This web tier is stateless, and can therefore be replicated without concern for multicast communication or alternative EAP clustering setup. This service relies on the product, sales, and billing services, while the first two in turn rely on the MySQL product-db and sales-db services.
2.1. Overview
This reference architecture may be deployed with either a single, or three master hosts. In both cases, it is assumed that ocp-master1 refers to one (or the only) OpenShift master host and that the environment includes two OpenShift node hosts with the host names of ocp-node1 and ocp-node2.
It is further assumed that OpenShift has been installed by the root user and that a regular user has been created with basic access to the host machine, as well as access to OpenShift through its identity providers.
2.1.1. OpenShift Login
Log in to the master host as a regular user, and use the oc utility to authenticate against OpenShift:
$ oc login -u ocuser --certificate-authority=/etc/origin/master/ca.crt \ --server=https://ocp-master1.hostname.example.com:8443 Authentication required for https://ocp-master1.hostname.example.com:8443 (openshift) Username: ocuser Password: PASSWORD Login successful. Welcome! See 'oc help' to get started.
2.1.2. Creating a New Project
Create a new project called deploy-project for this user:
$ oc new-project deploy-project --display-name="deployment on openshift project" --description="This is a project to demo different deployment options on openshift"

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.