Deploying KillBill/Kaui on OpenShift
This article takes a look at how to install, configure, and deploy both KillBill/Kaui on OpenShift using Kubernetes.
Join the DZone community and get the full member experience.Join For Free
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:
Configure the Docker daemon by adding the following to the
/etc/docker/daemon.json file (create the file if it is not already there):
Step 3: Start the OpenShift Cluster
Run the following to start the OpenShift Cluster:
The process takes several minutes. When it is finished, you should see the following:
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:
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.
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.
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:
Finally, repeat the steps for deploying an image for the killbill/kaui:2.0.1 with the following environment variables:
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!
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.
Opinions expressed by DZone contributors are their own.