Chapter 2. Adding API Designer as a service to your OpenShift Cluster

2.1. Adding API Designer as a service to an OpenShift 4 project

For OpenShift 4.x, you need to verify that your OpenShift administrator has installed the API Designer operator in your project as described in the Fuse on OpenShift Guide.

Optionally, the OpenShift administrator might have also added the API Designer as a service to the project. If not, you must do that task.

Note

A previous name for API Designer, Apicurito, is still visible in the API Designer operator’s interface.

Prerequisite

Your OpenShift administrator has installed the API Designer operator in your OpenShift project.

Procedure

  1. In your web browser, open the OpenShift console and log in with your credentials (for example, username developer and password developer).
  2. Select the project that includes the API Designer operator.
  3. Select Topology and verify that you see an icon that is labeled fuse-apicurito.

    If there are icons for apicurito-service-ui and apicurito-service-generator then your OpenShift administrator already added the API Designer as a service to the project and you can skip the rest of these steps.

    If there are no icons for apicurito-service-ui and apicurito-service-generator, continue to the next step.

  4. In the left navigation pane, click Add+.
  5. Under the Developer Catalog section, click Operator Backed.
  6. In the search field, type Apicurito to filter the catalog items.
  7. Click the Apicurito provided by Red Hat card.
  8. Click Create.

    A default form with a minimal starting template for the API Designer instance opens. Accept the default values or, optionally, edit them.

  9. Click Create to trigger the start up of the pods, services, and other components of the new API Designer instance.
  10. To verify that the API Designer service is added to the project, select Topology and then confirm that you see icons for apicurito-service-ui and apicurito-service-generator.
  11. To open the API designer, click the URL link on the apicurito-service-ui icon.

2.2. Adding API Designer as a service to an OpenShift 3.11 project

You can add API Designer as a service to your OpenShift 3.11 project by deploying the API Designer template from the command line.

Prerequisites

  • Obtain the hostname that will allow you to access API Designer by following the guidelines recommended by your OpenShift system administrator.
  • Verify that the Fuse on OpenShift images and templates, including apidesigner-ui and fuse-apidesigner-generator, are installed on your OpenShift cluster, by running the following command in a command window:

    oc get is -n openshift

    If the images and templates are not pre-installed, or if the provided versions are out of date, install (or update) the Fuse on OpenShift images and templates as described in the Fuse on OpenShift Guide.

Procedure

To add the API Designer service from the command line:

  1. In a command window, log in to the OpenShift server:

    oc login -u developer -p developer
  2. Create a new project namespace. For example, the following command creates a new project named myproject:

    oc new-project myproject
  3. Create a new application based on the API Designer template by running the following command (where myproject is the name of your project):

    oc new-app -n myproject -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.2.0.fuse-sb2-7_11_0-00022-redhat-00001/fuse-apicurito.yml -p ROUTE_HOSTNAME=myhost

    Note: Optionally, you can specify other template parameters by appending additional -p options to the oc new-app command. For example, if you installed the Fuse on OpenShift images and templates in a namespace other than the default openshift namespace, you can set the IMAGE_STREAM_NAMESPACE to specify the namespace in which the Fuse image streams are installed:

    oc new-app -n myproject -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.2.0.fuse-sb2-7_11_0-00022-redhat-00001/fuse-apicurito.yml -p ROUTE_HOSTNAME=myhost -p IMAGE_STREAM_NAMESPACE=othernamespace
  4. Obtain the status and the URL of your API Designer deployment by running this command:

    oc status

    If the API Designer is not deployed, run the following command to verify that you installed the correct versions of the apicurito-ui and fuse-apicurito-generator images:

    oc get is -n openshift | grep "apicurito"
  5. To access the API Designer from a browser, use the provided URL (for example, https://apicurito.192.168.64.12.nip.io).