Skip to content

Latest commit

 

History

History
176 lines (111 loc) · 8.66 KB

1-introduction.adoc

File metadata and controls

176 lines (111 loc) · 8.66 KB

1. Introduction - 10 minutes

Application modernization strategies are often categorized into the 6R’s framework that was popularized by Amazon (and prior the 5Rs by Gartner). Here is what they mean.

Modernization Strategies

Red Hat helps our customers' application modernization journey with this approach:

Modernization Approach

This workshop will walk you through 2 of the phases (Assess, Rationalize) as following steps:

1.1. Understand the Globex Retail System Architecture

The Globex system (workshop environment) has the whole microservices applications that are deployed multiple platforms such as virtual machines and container platform as below.

architecture_initial

Your initial state for this workshop is an environment that is spread over Red Hat Virtualization and Red Hat OpenShift Container Platform.

Your application has been partially already moved from your legacy environments to OpenShift.

The Globex retail system is multiple services consisting of a Node.js frontend service which is getting its data via a gateway service. The gateway service is connected to three backend services: customers, orders and inventory. Each of the backend services uses its own database to store data.

The services running on OpenShift are deployed in a namespace retail. The services are also managed using a GitOps approach by ArgoCD.

Note

You might see the customers pods are failed to run due to ImagePullBackOff Error. It will be fixed when you finish the Deploy to Kubernetes section.

All source code for the applications as well as the GitOps YAML manifests for all services are stored in a (GitHub compatible) Gitea repository that for workshop purposes is hosted on the OpenShift cluster.

The problem right now is the customers service:

  • The customers service uses an old Java code base running on Apache Tomcat in a VM on Red Hat Virtualization. In the course of this demonstration you will modernize the Java Code and then deploy the application to OpenShift on top of Red Hat JBoss Web Server.

  • The customers database is using an Oracle database running as a VM in Red Hat Virtualization. Because this is Oracle you can not deploy the database as a Pod on OpenShift - therefore you will migrate the VM to OpenShift Virtualization using the OpenShift Migration Toolkit for Virtualization.

When you have finished this demonstration your deployment architecture should look like this:

architecture_completed

1.2. Workshop Environment

1.2.1. Claim the Shared Workshop Cluster

Open a new web browser to access the RHPDS page.

user-login

Once you logged in successfully, the detail information of the shared cluster environment shows as below.

shared-cluster-details
Important

You have to use an unique username (e.g. user1) while you’re running the hands-on labs. For example, you need to deploy applications to your own project (e.g. retail-user1). Keep in mind that you should replace userXX with your own username in the next labs.

1.2.2. OpenShift Cluster

Your OpenShift cluster is already configured with everything you need. Here are the details:

  • Latest stable OpenShift Container Platform is deployed as a bare metal single node OpenShift environment.

  • The following operators have been installed and configured:

    • Gitea to host the source code repositories)

    • OpenShift Virtualization to ultimately run the migrated Oracle VM)

    • Migration Toolkit for Virtualization to facilitate the migration of the Oracle VM from Red Hat Virtualization to Red Hat OpenShift Container Platform)

    • OpenShift GitOps to manage the deployed services using a GitOps approach through ArgoCD

    • OpenShift Pipelines to build the customer application from source code and deploy to the retail project using GitOps

    • Migration Toolkit for Applications (Tackle) to help modernize the customer service Java source code.

1.2.3. Visual Studio Code Server

Visual Studio (VS) Code Servers are already deployed in the OpenShift cluster to facilitate an easy demonstration environment. This means you don’t need to install and configure VS Code on your local environment but you can just use the one provided in a web browser.

This makes it easy to change any source code and configuration files in the cloned repository. The URL and password for the VS Code Server can be found in the shared environment detail page.

Open a new browser to access the VS Code server using the following credential.

  • Password: openshift

vscode-server-login

The graphical user interface (GUI) should look like:

VSCode

1.3. Explore the Globex Retail Services (GUI)

You can check what the Globex retail service looks like currently by accessing the frontend web application. To find the URL to access the Frontend application, you need to use the OpenShift command line tool (oc). Go to the VS Code server and Open a new terminal that already installed the oc command by default.

Click on New Terminal in Terminal menu in the VS Code. Once a new terminal is open, run the following oc command.

Note

Replace userXX with your own information in the shared environment detail page.

oc login -u userXX -p openshift https://openshift.default.svc:443
vscode-terminal

Find the Route URL for the Frontend application. Run the following oc command in the VS Code server terminal.

oc get route ordersfrontend -n retail-userXX

The output should look like:

NAME             HOST/PORT                                                                PATH   SERVICES         PORT   TERMINATION     WILDCARD
ordersfrontend   ordersfrontend-retail-user1.apps.cluster-mkddz.sandbox1883.opentlc.com          ordersfrontend   web    edge/Redirect   None

Navigate to the orders frontend route. You can use either https or http (which will be redirected to https).

Frontend

Click through the three panels on the left.

  • Customers shows the list of the customer information such as fullname, city, country, and username.

  • Orders shows current order information including relevant customer data.

  • Products shows the current inventory information.

1.4. Access the Customer Data

The RHV environment not only has the Oracle Database VM deployed but it also hosts another VM which runs the old customer application on top of Apache Tomcat.

From a terminal window you can use curl to demonstrate that the application is connected to the database.

Use the IP Address of the Customer Service (Tomcat VM) to access the customer service. You can run the following curl command in the VS Code server’s terminal or your local environment since the Tomcat IP address is publicly accessible.

Run the following curl commands in the VS Code server terminal.

curl http://YOUR_Tomcat_VM_IP_ADDR:8080/customers-tomcat-0.0.1-SNAPSHOT/customers/1 ; echo

The output should look like:

{"id":1,"username":"phlegm_master_19","name":"Guybrush","surname":"Threepwood","address":"1060 West Addison","zipCode":"ME-001","city":"Melee Town","country":"Melee Island"}

Try to get another customer data.

curl http://YOUR_Tomcat_VM_IP_ADDR:8080/customers-tomcat-0.0.1-SNAPSHOT/customers/2 ; echo

The output should look like:

{"id":2,"username":"hate_guybrush","name":"Pirate","surname":"Lechuck","address":"Caverns of Meat, no number","zipCode":"MO-666","city":"Giant Monkey Head","country":"Monkey Island"}

➡️ 2. Assessment