Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 2.41 KB

lab1-instructions.adoc

File metadata and controls

47 lines (31 loc) · 2.41 KB

Lab 1 - Deploying on OpenShift Application Runtimes

In this lab, you will learn how to take an existing Spring Boot application that has been converted to use RHOAR (Red Hat OpenShift Application Runtimes). RHOAR is a collection of Red Hat Supported Microservice Framworks optimized for deployment on OpenShift. See http://launch.openshift.io for more information on the complete set of languages/technologies supported.

The Spring Boot application we will be deploying is a basic Product Catalog MVC Web App, using a PostgreSQL DB for persistence. You can review the updates made to the original Spring application to use the RHOAR framework components at https://github.com/rhoar-enablement/spring/blob/master/lab4/docs/lab4-instructions.adoc .

For the purpose of this lab we will walk you through how to take the completed Spring Boot/RHOAR project and deploy it to OpenShift. Before starting, ensure you have forked and cloned this repo into a local working directory and have the ability to create or access a personal OpenShift project for this Lab.

1. Deploy to OpenShift

  1. Login to the remote OpenShift environment (Get instructions from your OpenShift admin)

  2. Create a new project with a unique name or ensure an existing OpenShift project is selected

    oc new-project product-catalog-<unique number>
    or
    oc project <your-project-name>
  3. Create a Postgres database

    oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data openshift/postgresql --name=my-database
  4. Build and deploy your project (ensure you are in the /lab directory of your local repo)

    mvn clean fabric8:deploy -Popenshift

2. Verify Deployment and Application within OpenShift

  1. Login to the OpenShift Web Console (Get URL from your OpenShift admin)

  2. From the Web Console Home Page, scroll down and select the Project used for this Lab

  3. From the Overview Page of your Project, you should see the following Applications and Components running once they have completed deployment:

    spring lab deployment1
  4. Within the product-catalog application, open the URL from the created Route in another browser tab and verify the Spring application is working:

    spring lab app1