Pivotal Cloud Foundry resources for WSO2 API Manager 2.6.0

Vimukthi Perera
Feb 12 · 4 min read

WSO2 API Manager installation options now provide the support for Pivotal Cloud Foundry(PCF) platform. I’m going to walk you through the steps of deploying WSO2 API Manager on PCF.

https://pivotal.io/platform

Prerequisites:

  • A pre-configured Pivotal environment: If you do not have a pivotal environment and you need to create one, here is a good article to follow. Also, you can refer to the docs provided by Pivotal.
  • A database to point the DBs required: This DB should contain the tables you need to run WSO2 API Manager. You can find the DB scripts inside <APIM_HOME>/dbscripts/ directory.
  • BOSH CLI installed.
  • Tile Generator CLI installed.

1. Create the BOSH release

First, we need to create the deployment using BOSH. You can clone the GitHub repository provided by WSO2 for reference.

git clone https://github.com/wso2/pivotal-cf-apim.git

For the moment, these resources support API Manager pattern-1 and pattern-2. Let’s choose pattern-2 for the moment as it is a bit complicated than pattern-1 :)

WSO2 API Manager pattern-2
cd pivotal-cf-apim/pattern-2

Inside pattern-2 directory, you will see two directories.

bosh-deployment
tile

If you navigate to bosh-deployment, you can see all the resources needed to deploy API Manager pattern-2 on PCF. All the configurations are set to deploy pattern-2 on PCF.

To deploy pattern-2, you need to add the following files to the dist folder in the root of the bosh-deployment directory.

mssql-jdbc-7.0.0.jre8.jar
mysql-connector-java-5.1.45-bin.jar
OpenJDK8U-jdk_x64_linux_hotspot_8u192b12.tar.gz
wso2am-2.6.0.zip
wso2am-analytics-2.6.0.zip
wso2is-km-5.7.0.zip

You might wonder why we need to add both MySQL and MSSQL JDBC drivers to the dist folder. This is to add flexibility to the deployment. We cannot change the tile once it is created, as the tile is immutable. But we can give options to switch between different databases.

The same reason applies to wso2is-km too. For API Manager pattern-2 WSO2 has defined the default key manager which comes with the API Manager product. But if a user needs to use WSO2 Identity Server as Key Manager, you can define it in the tile.yml in tile directory as follows.

tile.yml

Also, if you need to remove any of the files, you can do it by changing the BOSH deployments as required.

Now we need to create the BOSH release. To do that, WSO2 has provided two scripts with the deployment. First, you need to run the create.sh script.

./create.sh

Then run the export.sh script.

./export.sh

This will create the bosh-release in the root of the bosh-deployment directory as wso2am-2.6.0-bosh-release.tgz

2. Build the tile with the BOSH release

Now you need to add routing-release provided by PCF to the root folder of the tile directory as well. You can download the tarball from here. This routing-release delivers HTTP and TCP routing for Cloud Foundry.

Then run the build.sh script to build the tile.

./build.sh

Then a tile with the name wso2apim-tile-0.0.1.pivotal will be created inside the root of the product folder under the tile-generator directory.

3. Deploy WSO2 API Manager pattern-2 on PCF

Login to PCF Ops Manager and upload the tile you created using import product option.

Import the tile

After you upload the tile, add the tile to the PCF environment by clicking the + next to it.

Add the tile

Once added, click on the tile to add database configurations and other settings.

After configuring, go back to PCF Ops Manager to apply changes. Click on the REVIEW PENDING CHANGES button to view the changes.

Then tick against WSO2 API Manager 2.6.0 as follows and click to apply changes.

Once the changes are applied, you can access the management console, publisher, store by using the following URLs. Here, you need to replace domain_name with your domain name.

https://wso2apim.sys.<domain_name>/carbon/
https://wso2apim.sys.<domain_name>/publisher/
https://wso2apim.sys.<domain_name>/store/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade