Monday, May 9, 2016

Zero to Clustered Application on Kubernetes with Bitnami

Kubernetes, a popular Docker container orchestration platform, promises to make deploying and managing containerized applications simple. This post walks through configuring and deploying a widely used web application, the Redmine issue tracking application, packaged as Docker containers.

This tutorial is aimed at developers and operators interested in learning about containerizing applications on Kubernetes and looking for solutions to common concerns including configurability, application state, and health monitoring.

Before you get started

You’ll need to setup a Kubernetes cluster. There are many deployment options for Kubernetes as documented here (http://kubernetes.io/docs/getting-started-guides/binary_release/) Particularly if you’re new to Kubernetes we recommend starting with Google Container Engine (https://cloud.google.com/container-engine/)

You’ll need a copy of the helm package manager for Kubernetes for your platform. Helm can be downloaded directly from https://helm.sh. Version 0.5.0 or higher is required.

Deploying Redmine

1. Helm uses charts to describe how to deploy a particular applications and their metadata. Collections of charts are organized into repositories so our first step is to add the Bitnami chart repository to helm:

helm repo add bitnami http://github.com/bitnami/charts.git 



2. First we'll create an MariaDB database instance for Redmine to use:

helm install bitnami/mariadb

Once MariaDB has been deployed we can deploy the Redmine application

helm install bitnami/redmine

Redmine will take a minute or two to start, the ready count shows when the application has started:

kubectl get po


The Redmine pod will show a ready count of 1 / 1, as shown above,  when redmine has finished launching.

To access the running Redmine application we need to know the IP address of the Kubernetes load balancer:

kubectl describe service redmine

To access Redmine type the “Load Balancer Ingress” address into your web browser:

The default username and password are "user" and "bitnami"

Digging Deeper - customizing your application deployment

One of the great features of Kubernetes and Helm is the ability to customize and configure each application deployment. Helm supports customizing applications by editing and regenerating them before installing. The Bitnami Redmine chart has been designed with this in mind and provides a range of customization options including:
  • Changing the default MariaDB password
  • Setting the Redmine admin user and password
  • Configuring Redmine to use SMTP (email) 
  • Configuring the Redmine UI language 
Note: When modifying the default values in values.toml remember to run "helm generate redmine" before installing. Remember to make sure the MariaDB database password matches the Redmine.

A full walkthrough including advanced configuration topics can be found here:

https://github.com/bitnami/charts/tree/master/_docs/redmine

Let us know in the comments which other applications you want to deploy on Kubernetes.