{{announcement.body}}
{{announcement.title}}

Deploying KillBill/Kaui on OpenShift

DZone 's Guide to

Deploying KillBill/Kaui on OpenShift

This article takes a look at how to install, configure, and deploy both KillBill/Kaui on OpenShift using Kubernetes.

· Cloud Zone ·
Free Resource

Introduction

In this tutorial, we will guide you step-by-step on how to deploy three separate pods (the Kubernetes equivalence of a container) for KillBill, Kaui, and MariaDB on an OpenShift cluster.

Step 1: Install Docker

The recommended way of installing Docker and Docker Compose is via Docker’s repositories, for ease of installation and upgrade tasks.

Select the appropriate instructions for your preferred operating system.

Step 2: Install OpenShift Origin Client Tools

Select the appropriate release for your operating system: https://github.com/openshift/origin/releases.

Note, at the time of this post, we will be using the latest release (v3.11 — v4 is still in beta).

In a terminal, run the following:

Java
 




x


 
1
$ wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
2
$ tar -xzvf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
3
$ cd openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit
4
$ sudo cp oc /usr/local/bin
5
 
          


Configure the Docker daemon by adding the following to the /etc/docker/daemon.json file (create the file if it is not already there):

Shell
 




xxxxxxxxxx
1


 
1
{
2
   "insecure-registries": [
3
     "172.30.0.0/16"
4
   ]
5
}


Afterwards, run:

Shell
 




xxxxxxxxxx
1


 
1
$ sudo systemctl restart docker
2
 
          


Step 3: Start the OpenShift Cluster

Run the following to start the OpenShift Cluster:

Shell
 




xxxxxxxxxx
1


 
1
$ sudo oc cluster up


The process takes several minutes. When it is finished, you should see the following:

Starting Openshift cluster

Navigate to the address listed to login to the OpenShift Console. Once you log in, you'll see the following. Select the newly created project, My Project in the right-hand panel.

Step 4: Deploy KillBill, Kaui, and MariaDB on OpenShift

By default, OpenShift does not allow containers to run as root. We can bypass this by issuing the following commands:

Shell
 




xxxxxxxxxx
1


 
1
$ sudo oc login -u system:admin -n default
2
$ sudo oc adm policy add-scc-to-group anyuid system:authenticated


For more information, see this document

Since KillBill offers official images hosted on DockerHub, deploying it to OpenShift is relatively simple. After selecting My Project, click on the Deploy Image button.

Getting started


Select the option for Image name, enter: killbill/mariadb:0.22 and select the magnifying glass.For name, enter db. Define the following environment variables.Defining environment variables

Click Deploy.

At the top of the console, navigate to Add to Project > Deploy Image and repeat the steps for deploying an image for the killbill/killbill:0.22.2 container with the following environment variables:

Deploying the image

Finally, repeat the steps for deploying an image for the killbill/kaui:2.0.1 with the following environment variables:

Deploying killbill/kaui:2.0.1

Step 5: Create a Route to Kaui

In order to expose the Kaui service, we can add a route. Simply go to Applications > Routes and in the upper right-hand corner, click Create Route. Give the route a name, and for the Service, select kaui and click create at the bottom of the screen.

If you navigate back to Applications > Routes, you should see the newly created route for Kaui created.Select the generated Hostname, and you should now be able to access the Kaui UI!

Conclusion

By now, you have seen a brief showcase of a KillBill deployment on OpenShift. Check out the next guide on integrating KillBill with Stripe for a monthly subscription model.

Topics:
integration ,kaui ,killbill ,mariadb ,open source ,openshift ,payments

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}