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:

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.

2. Installing Minishift

To test the Fabric8 Launcher tool on your local machine, you can use either Minishift or Red Hat Container Development Kit.

Procedure
  1. Follow the instructions for installing Minishift:

    The steps for installing Minishift vary by platform.
  2. Verify you have the Minishift installed and configured:

    $ minishift version
  3. Start and stop Minishift:

    $ minishift start
    ...
    $ minishift stop
    Stopping local OpenShift cluster...
    Cluster stopped.
  4. Determine the command to add the correct version of the oc binary to your path and run the command:

    Example Result of oc-env on Red Hat Container Development Kit
    $ minishift oc-env
    export PATH="/Users/john/.minishift/cache/oc/v3.5.5.8:$PATH"
    # Run this command to configure your shell:
    # eval $(minishift oc-env)
    
    $ eval $(minishift oc-env)
    You must have the oc binary installed and it must match the version of Minishift that you are using.

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.

SSL warning
Prerequisites
Procedure
  1. Start Minishift with the default virtual machine driver:

    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 --vm-driver flag:

    $ 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.

    On macOS, the default virtual machine driver, xhyve, can be unreliable. If you experience issues, specifying VirtualBox is a reliable alternative.
  2. Open the Minishift Web console.

    $ minishift console

    Alternatively, use the URL provided in the log information.

  3. Log in using the developer username and an arbitrary password.

  4. Optionally, delete the preconfigured project:

    1. Next to the project name, click the three-dot menu icon.

    2. Select Delete Project.

      OpenShift Console Home

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.

Prerequisites
Procedure
  1. Using a web browser, navigate to https://github.com/settings/tokens.

  2. Select Generate new token.

  3. Add a token description, for example Fabric8 Launcher tool on a Minishift or CDK.

  4. Select the check boxes of the following parent scopes and all their children:

    • public_repo

    • read:org

    • admin:repo_hook

  5. Click Generate token.

  6. 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.

    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.

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.

Prerequisites
  • Admin access to an OpenShift cluster.

Procedure
  1. Assign the cluster-admin role to your user account on the OpenShift cluster.

    $ oc adm policy --as system:admin add-cluster-role-to-user cluster-admin USER_ACCOUNT_NAME
  2. Log in to your OpenShift cluster using your user account with cluster credentials:

    $ oc login OPENSHIFT_CLUSTER_URL
  3. Create a project to host the operator:

    $ oc new-project launcher-operator
  4. Create a personal GitHub access token. Ensure that you set the following scope when creating the token:

    • repo

    • admin:repo_hook

    • delete_repo

  5. Create a new secret using your newly created personal GitHub access token:

    $ oc create secret generic launcher-secrets --from-literal=github-token=GITHUB_TOKEN
  6. Download and extract the ZIP file containing the operator and navigate to the directory containing the extracted resources.

    $ cd launcher-operator
  7. Process the YAML templates in the /deploy subdirectory:

    $  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

  8. Install the following custom resource in order to initiate the deployment of the Fabric8 Launcher tool.

    $ oc create -f example/launcher_cr.yaml
  9. 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
  10. 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
  11. Navigate to the route URL to start using Fabric8 Launcher.

Additional Resources

Appendix A: Glossary

A.1. Product and project names

developers.redhat.com/launch

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.

A.2. Terms specific to Fabric8 Launcher

Example

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.

Example application

A language-specific implementation of a particular example on a particular runtime. Example applications are listed in an examples catalog.

For example, an example application is a web service with a REST API implemented using the Thorntail runtime.

Examples Catalog

A Git repository that contains information about example applications.

Runtime

A platform that executes an example application. For example, Thorntail or Eclipse Vert.x.