Install and Configure the Fabric8 Launcher Tool
For Use with Red Hat OpenShift Application Runtimes
This guide walks you through the process of installing the Fabric8 Launcher tool on an OpenShift cluster. To test the launcher tool locally on your machine you can use:
Chapter 1. How the Fabric8 Launcher tool works
The Fabric8 Launcher tool runs on OpenShift and lets you create functional example applications. The Fabric8 Launcher tool walks you through:
- choosing the example application you want to generate,
- choosing the runtime you want to use, and
- choosing how you want to build and execute the example application.
The Fabric8 Launcher tool uses your choices to generate a custom project, called an example application, and either launches it directly to the same OpenShift instance, or provides a downloadable ZIP version of the project.
Chapter 2. Installing Minishift
To test the Fabric8 Launcher tool on your local machine, you can use either Minishift or Red Hat Container Development Kit.
Follow the instructions for installing Minishift:
- The installation steps for Minishift are available in the OpenShift documentation.
- The installation steps for Red Hat Container Development Kit are available in the Red Hat Container Development Kit Installation Guide.
The steps for installing Minishift vary by platform.
Verify you have the Minishift installed and configured:
$ minishift version
Start and stop Minishift:
$ minishift start ... $ minishift stop Stopping local OpenShift cluster... Cluster stopped.
Determine the command to add the correct version of the
ocbinary to your path and run the command:
Example Result of
oc-envon Red Hat Container Development Kit
$ minishift oc-env export PATH="/Users/john/.minishift/cache/oc/v188.8.131.52:$PATH" # Run this command to configure your shell: # eval $(minishift oc-env) $ eval $(minishift oc-env)Warning
You must have the
ocbinary installed and it must match the version of Minishift that you are using.
Chapter 3. Starting and configuring Minishift for the Fabric8 Launcher tool
This chapter contains instructions for starting the Minishift and configuring it to execute the Fabric8 Launcher tool.
Starting your Minishift can trigger a download of large virtual machines or Linux container images. This can take a long time. Subsequent startups are expected to be shorter if the virtual machines and Linux container images remain cached.
Because Minishift is intended for development purposes, it uses HTTPS for the web console and only provides a self-signed certificate. If your browser prevents you from accessing the page due to an SSL error, you must allow your browser to bypass SSL security policies for the Minishift URL to use it. The screenshot below shows the warning message in the Google Chrome browser.
Start Minishift with the default virtual machine driver:Note
Depending on your operating system, virtual machine driver, and the number of example applications you run, the memory allocated Minishift or CDK can be insufficient. In this case, increase the memory allocation.
$ minishift start --memory=4096 ... OpenShift server started. The server is accessible via web console at: https://192.168.42.152:8443
Alternatively, specify a virtual machine driver other than the default using the
$ minishift start --memory=4096 --vm-driver=virtualbox
Depending on your system configuration, it is possible that you must manually specify an alternative virtual machine driver. You must have virtual machine software, such as VirtualBox, installed before you specify it.Note
On macOS, the default virtual machine driver,
xhyve, can be unreliable. If you experience issues, specifying
VirtualBoxis a reliable alternative.
Open the Minishift Web console.
$ minishift console
Alternatively, use the URL provided in the log information.
Log in using the
developerusername and an arbitrary password.
Optionally, delete the preconfigured project:
- Next to the project name, click the three-dot menu icon.
Select Delete Project.
Chapter 4. Creating a GitHub personal access token
To install the Fabric8 Launcher tool on a Minishift or CDK, you must provide the Fabric8 Launcher tool with a GitHub personal access token. This enables the Fabric8 Launcher tool to create example applications and save them as Git repositories in your GitHub namespace.
Using a web browser, navigate to
- Select Generate new token.
Add a token description, for example
Fabric8 Launcher tool on a Minishift or CDK.
Select the check boxes of the following parent scopes and all their children:
- Click Generate token.
Save the hex code of the personal access token. You need this to complete the installation of the Fabric8 Launcher tool on your Minishift or CDK.Important
This hex code is displayed only once and cannot be retrieved after you leave the page. If you lose the code, you will need to create a new personal access token to install the Fabric8 Launcher tool on a Minishift or CDK again.
Chapter 5. Installing Fabric8 Launcher Tool
Install an instance of the Fabric8 Launcher tool, which allows you to test the functionality or make modifications to the service using a web interface.
5.1. Installing the Fabric8 Launcher tool using an operator
Set up an operator to install the Fabric8 Launcher tool on an OpenShift cluster. The following procedure works with clusters running on OpenShift 3.11.
- Admin access to an OpenShift cluster.
cluster-adminrole to your user account on the OpenShift cluster.
$ oc adm policy --as system:admin add-cluster-role-to-user cluster-admin USER_ACCOUNT_NAME
Log in to your OpenShift cluster using your user account with
$ oc login OPENSHIFT_CLUSTER_URL
Create a project to host the operator:
$ oc new-project launcher-operator
Create a personal GitHub access token. Ensure that you set the following scope when creating the token:
Create a new secret using your newly created personal GitHub access token:
$ oc create secret generic launcher-secrets --from-literal=github-token=GITHUB_TOKEN
Download and extract the ZIP file containing the operator and navigate to the directory containing the extracted resources.
$ cd launcher-operator
Process the YAML templates in the
$ oc create -R -f ./deploy
Based on the templates, OpenShift automatically installs:
- a custom resource definition for the Launcher operator
- a service account for the Launcher operator
- access role definitions for the launcher operator
- access role bindings for the Launcher operator
Install the following custom resource in order to initiate the deployment of the Fabric8 Launcher tool.
$ oc create -f example/launcher_cr.yaml
Monitor the status of the Fabric8 Launcher tool until it completes start up.
$ oc get pods -w NAME READY STATUS RESTARTS AGE configmapcontroller-1-deploy 1/1 Running 0 46s configmapcontroller-1-aaaaa 0/1 ContainerCreating 0 44s launcher-backend-1-deploy 1/1 Running 0 46s ... launcher-backend-2-aaaaa 0/1 Running 0 5s launcher-frontend-2-aaaaa 0/1 Running 0 6s
Obtain the route of your Fabric8 Launcher tool.
$ oc get routes NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD launcher launcher.launcher.LOCAL_OPENSHIFT_HOSTNAME launcher-frontend <all> None
- Navigate to the route URL to start using Fabric8 Launcher.
- See the Getting Started with Red Hat OpenShift Application Runtimes for a walk-through of launching an example application.
Read the runtime guides for an overview of the runtimes and their examples:
Appendix A. Using a Nexus repository server on a Minishift or CDK
While developing your cloud-native applications with Java and Maven, you may be required to build them repeatedly. You can deploy a Nexus Repository server alongside the Fabric8 Launcher tool on your Minishift or CDK and use it to fetch artifacts from the Maven Central repository and cache them locally. This reduces the network load when building your application, and helps accelerate the build and rolling updates.
- Your Minishift or CDK set up. Follow the instructions in Install and Configure the Fabric8 Launcher Tool.
Your Minishift or CDK configured to use at least 4096 MiB of RAM and use the required
ocCLI tool version.
minishift delete # Delete the previous instance of Minishift or CDK minishift config set memory 4096 minishift startWarning
The procedure described below works with Minishift. It has not been tested for use with CDK.
- The Fabric8 Launcher tool deployed to your Minishift or CDK.
- An example application deployed to your Minishift or CDK.
Log in to your Minishift or CDK instance.
oc login https://OPENSHIFT_CLUSTER_URL -u developer -p developer
You can reuse the Docker daemon instance used by Minishift or CDK to download the latest versions of the Nexus Docker container image.
eval $(minishift docker-env) docker pull openshift/jenkins-2-centos7 docker pull openshiftio/launchpad-jenkins-slave docker pull sonatype/nexus
Create a new project to contain the Nexus server. You can also use the New Project button on the Web console to do this.
oc new-project NEXUS_PROJECT_NAME
Deploy the Nexus container image.
oc new-app sonatype/nexus
Expose the service route URL of the Nexus server.
oc expose svc/nexus
Attach a persistent volume claim with a minimum size of 10 GiB to the pod running your Nexus application.
oc volumes dc/nexus --add --name 'nexus-volume-1' --type 'pvc' --mount-path '/sonatype-work/' --claim-name 'nexus-pv' --claim-size '10Gi' --overwrite
Navigate to the project containing your example application.
oc project MY_PROJECT_NAME
Define and start a new build.
Pass in a parameter to set the value of the
MAVEN_MIRROR_URLto match the service URL of your Nexus application:Note
Ensure that the YAML template of the builder image you are using for your application has the
MAVEN_MIRROR_URLenvironment variable defined. If it does not, see the Nexus documentation for instructions on configuring your build manually before proceeding.
$ oc new-build MY_APP_NAME:latest~SCM_REPOSITORY_URL \ -e MAVEN_MIRROR_URL='http://nexus.NEXUS_PROJECT_NAME:8081/nexus/content/groups/public'
Nexus comes pre-configured for the Maven Central repository, but you may need other repositories for your application. To access images provided by Red Hat, add the Red Hat JBoss Middleware Early Access Maven Repository to your Nexus instance.
Ensure that your new build is using Nexus to retrieve artifacts. Do one of the following:
http://nexus-NEXUS_PROJECT_NAME.LOCAL_OPENSHIFT_HOSTNAME/nexus/content/groups/publicto view the list of artifacts stored in your local repository.
Check the log output of the build:
$ oc logs build/MY_APP_NAME-1 --follow
If your build uses Nexus to retrieve artifacts, the build log output should reference the path
- Navigate to
Appendix B. Glossary
B.1. Product and project names
- developers.redhat.com/launch is a standalone getting started experience offered by Red Hat for jumpstarting cloud-native application development on OpenShift. It provides a way of creating functional example applications as well as an easy way to build and deploy these example applications on OpenShift.
- Fabric8 Launcher
- The Fabric8 Launcher is the upstream project on which developers.redhat.com/launch is based.
- Minishift or CDK
- An OpenShift cluster running on your machine using Minishift.
B.2. Terms specific to Fabric8 Launcher
An application specification, for example a web service with a REST API.
Examples generally do not specify which language or platform they should run on; the description only contains the intended functionality.
- Examples Catalog
- A Git repository that contains information about example applications.
- A platform that executes an example application. For example, Thorntail or Eclipse Vert.x.