Quick steps to deploy a WSO2 Product on Kubernetes

WSO2, Inc has a wide range of middleware products categorized under Integration, Analytics, Identity Management and Security, Services and App Dev, Management and Governance, and Mobile and IoT [1].

With great advantages in containerization, WSO2 facilitates by providing artifacts to deploy the products on Kubernetes.


Prerequisites
- Git client
- Docker
- Kubernetes

Step 0. For setting up the Kubernetes environment

sh run.sh
  • WSO2 uses mysql as the default database for the deployment on Kubernetes. Therefore ssh into the minion and do a docker pull for mysql:5.5 (5.5 is the recommended version).
vagrant ssh node-01
docker pull mysql:5.5


In this tutorial, I will use WSO2 ESB as the example.

Step 2. Copy the following distribution to the mentioned path

  • WSO2 Enterprise Service Bus distribution (4.9.0) to ‘<PUPPET_HOME>/modules/wso2esb/files
  • JDK 1.7_80 distribution to ‘<PUPPET_HOME>/modules/wso2base/files

Note: If your JDK version is different, edit the following lines in ‘<PUPPET_HOME>/hieradata/dev/wso2/common.yaml’ file

wso2base::java::java_install_dir: /mnt/jdk-7u80
wso2base::java::java_source_file: jdk-7u80-linux-x64.tar.gz

Step 3. Build the WSO2 docker image

  • Go to ‘<DOCKERFILES_HOME>/wso2esb’ and execute the following command
sh build.sh -v 4.9.0 -r 'puppet' -s 'kubernetes'

Note: Ensure docker daemon is running and also it is required to set the PUPPET_HOME environment variable.

export PUPPET_HOME=<path_to_the_puppet_modules>


Step 4. Load the build docker image to Kubernetes minion

  • Go to KUBERNETES_HOME and execute the following
sh load-images.sh

This is to load the locally built docker image to the Kubernetes minion.

Load the wso2esb-kubernetes:4.9.0 docker image and skip the rest.

wso2esb-kubernetes:4.9.0 (34734bdbd1f7) — Transfer? ( [y]es / [n]o / [e]xit ): y

Note: Ensure mysql:5.5 is also loaded in the Kubernetes node.


Step 5. Ready to deploy the WSO2 product on Kubernetes

Go to ‘KUBERNETES_ARTIFACTS_HOME/wso2esb’ and execute the following command

sh deploy.sh

Step 6. Accessing the management console of the deployed WSO2 Product.

  • Set an /etc/hosts entry
172.17.8.102 wso2esb-default
  • Access the wso2 management console.
https://wso2esb-default:32094/carbon

Note: Default login credentials is admin admin.


For more detailed understanding, you can refer the Kubernetes Artifacts documentation [5].