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 and subscribed to 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.
A previous name for API Designer, Apicurito, is still visible in the API Designer operator’s interface.
Prerequisite
- You have administrator access to the OpenShift cluster.
- You have configured authentication to the Red Hat Container Registry.
Procedure
- Start the OpenShift 4.x Server.
- In a web browser, navigate to the OpenShift console in your browser. Log in to the console with your credentials.
- Click Operators and then click OperatorHub.
- In the search field, type API Designer.
- Click API Designer card. The API Designer operator install page opens.
Click Install. The Install Operator page opens.
- For Installation mode, select a namespace (project) from the list of namespaces on the cluster,
For the Approval Strategy, select Automatic or Manual to configure how OpenShift handles updates to the API Designer Operator.
- If you select Automatic updates, when a new version of the API Designer operator is available, the OpenShift Operator Lifecycle Manager (OLM) automatically upgrades the running instance of the API Designer without human intervention.
- If you select Manual updates, when a newer version of an Operator is available, the OLM creates an update request. As a cluster administrator, you must then manually approve that update request to have the API Designer operator updated to the new version.
- Click Install to make the API Designer Operator available to the specified namespace (project).
- To verify that the API Designer is installed in the project, click Operators and then click Installed Operators to see the API Designer in the list.
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
andfuse-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:
In a command window, log in to the OpenShift server:
oc login -u developer -p developer
Create a new project namespace. For example, the following command creates a new project named myproject:
oc new-project myproject
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.1.0.fuse-sb2-7_10_0-00015-redhat-00001/fuse-apicurito.yml -p ROUTE_HOSTNAME=myhost
Note: Optionally, you can specify other template parameters by appending additional
-p
options to theoc 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 theIMAGE_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.1.0.fuse-sb2-7_10_0-00015-redhat-00001/fuse-apicurito.yml -p ROUTE_HOSTNAME=myhost -p IMAGE_STREAM_NAMESPACE=othernamespace
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
andfuse-apicurito-generator
images:oc get is -n openshift | grep "apicurito"
- To access the API Designer from a browser, use the provided URL (for example, https://apicurito.192.168.64.12.nip.io).