OpenShift

Minishift with JBoss EAP tutorial

Be like Deedee and think outside the box. Learn the easy way to automating the migration of your ageing J2EE/JEE assets into JBoss container based workloads. We will do this by taking the OpenShift minishift tool for a quick spin by creating a JBoss EAP application. This lab is another in the OpenShift MiniLabs series.

Deedee

Objectives

You are going to learn how to set up a local OpenShift instance using the minishift tool, load it up with the xPaaS assets and then use it to build a JBoss EAP container application. Together with the Windup migration tool, OpenShift makes it easy to automate and execute use cases such as migrating ageing UNIX J2EE applications to JEE container based workloads using JBoss EAP.

2000px-JBoss_logo.svg

Setup

Initial Installation

This tutorial will step you through a Mac OS/X installation of the minishift environment using the xhyve driver.  Shown below are the instructions for a brew based install, alternative approaches and operating systems are covered in the documentation.

$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ brew cask install minishift
$ minishift --help
$ minishift start

Instructions

Grab that coffee or preferred productivity adjunct and proceed as follows. You are going to:

  1. As the Cluster admin
    1. Replace the default imagestream shipped with RHEL based images
    2. Create the JBoss xPaaS templates and S2I factories
  2. As a Developer
    1. Create an OpenShift project
    2. Create a new application using the JBoss EAP S2I based on the kitchensink example
  3. As a Human
    1. Step back and marvel at your own awesomeness

1. xPaaS Configuration

The following instructions will assemble the xPaaS assets into your minishift environment for local lab usage. You can explore the Red Hat container catalog here.

$ oc login -u system:admin
$ oc project openshift
$ oc import-image jboss-eap-70 --from=registry.access.redhat.com/jboss-eap-7/eap70-openshift --confirm
$ oc get images | grep registry.access.redhat

2. Developer Steps

Create an instance of the JBoss EAP kitchensink sample application using the command line instructions below. This will create a project and then create a new application by invoking the source-to-image (S2I) factory using the source located at the git repo/branch/context-dir specified against the JBoss EAP v7 image. The same steps can be reproduced using the Console if you prefer – create new project, add application, choose the JBoss EAP7 image, and the fill in the git repo configuration settings.

$ oc login -u developer -p developer
$ oc new-project kitchensink --display-name='JBoss EAP Kitchensink' --description='JBoss EAP Kitchensink'
$ oc new-app jboss-eap-70~https://github.com/jboss-developer/jboss-eap-quickstarts.git#7.0.0.GA --context-dir='kitchensink' --name='kitchensink' --labels name='kitchensink'
$ oc expose service kitchensink
$ oc status -v

3. Verify Awesomeness

Wait for the build to complete and then verify success by pointing your Browser at the exposed application route. Note that the route exposed by your minishift instance may vary. The default address appears in the “minishift start” output.

$ curl http://kitchensink-kitchensink.192.168.99.100.nip.io

Trivia

Dockerfiles

That’s neat, but where are all those Dockerfile? You can find these inside the /root/buildinfo directory of the running pod. Knock yourself out :-

$ oc login -u developer -p developer
$ oc rsh `oc get pods -n kitchensink | grep Running | awk '{print $1}'`
sh-4.2$ cd /root/buildinfo
sh-4.2$ ls

 

Containers in the wild

Considering using Red Hat Container catalog assets outside of OpenShift? Read this knowledge base article.

But wait, there’s more

Visit OpenShift resources for further information on Minishift and related.

 

Leave a Reply