Files
charts/redmine

Redmine

Redmine is a free and open source, web-based project management and issue tracking tool.

Based on the Bitnami Redmine image for docker, this chart bootstraps a Redmine deployment on a Kubernetes cluster using Helm.

Prerequisites

Kubernetes Cluster

Setup up Kubernetes on Google Container Engine (GKE) using these instructions and create a cluster.

$ gcloud container clusters create my-cluster

The above command creates a new cluster named my-cluster. You can name the cluster according to your preferences. You could also use an existing cluster, in which case you should consider creating a different namespace for the Redmine deployment.

For setting up Kubernetes on other cloud platforms or bare-metal servers refer to the Kubernetes getting started guide.

Helm

Dubbed as the Kubernetes Package Manager, Helm bootstraps your Kubernetes cluster with Charts that provide ready-to-use workloads.

To install Helm, refer to the Helm install guide and ensure that the helm binary is in the PATH of your shell.

After installing Helm add the Bitnami Charts repo to Helm.

$ helm repo add bitnami https://github.com/bitnami/charts.git

If you are an existing user of the Bitnami charts repo, now is a good time to update your charts.

$ helm update

Dependencies

MariaDB

The Redmine chart depends on the MariaDB chart for setting up a database backend. As such we'll first deploy the Bitnami MariaDB chart.

Note:

Refer to the persistence section of the MariaDB chart for persistence of the data in the MariaDB database.

Step 1: Fetch the bitnami/mariadb chart to your workspace

$ helm fetch bitnami/mariadb

The MariaDB chart will be copied into your workspace, located at ~/.helm/workspace/charts/mariadb/.

Step 2 (Optional): Update the MariaDB root password

$ helm edit mariadb

The default value of the MariaDB root password is bitnami. Edit the value of mariadbPassword in tpl/values.toml to change it to your choosing.

Tip: If you have issues running the above command, add se autochdir to your ~/.vimrc profile or simply edit ~/.helm/workspace/charts/mariadb/tpl/values.toml in your favourite editor.

Step 3: Generate the chart

$ helm generate mariadb

The above command will generate the MariaDB chart with your changes from the last step.

Step 4: Deploy MariaDB

$ helm install mariadb

In the above command, Helm will deploy the MariaDB chart in the cluster. The deployment status of the MariaDB pods can be checked with kubectl using:

$ kubectl get pods -l provider=mariadb
NAME            READY     STATUS    RESTARTS   AGE
mariadb-3fu51   1/1       Running   0          1m

Persistence

You may skip this section if your only interested in testing the Redmine chart and have not yet made the decision to use it for your production workloads.

For persistence of the Redmine configuration and user file uploads, mount a storage volume at the /bitnami/redmine path of the Redmine pod.

By default the Redmine chart mounts a emptyDir volume.

From the emptyDir documentation: "An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node... When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."

To persist your Redmine data across Pod shutdown and startup we need to mount a persistent storage volume at /bitnami/redmine. For the purpose of demonstration we'll use a gcePersistentDisk.

Create a GCE PD using:

$ gcloud compute disks create --size=500GB --zone=us-central1-a redmine-data-disk

Note: You will be charged additionally for this volume.

Deploying the Redmine Chart

Now that we have MariaDB deployed and optionally created a persistent storage disk for Redmine, we are ready to deploy the Bitnami Redmine chart.

Step 1: Fetch the bitnami/redmine chart to your workspace

$ helm fetch bitnami/redmine

The Redmine chart will be copied into your workspace, located at ~/.helm/workspace/charts/redmine/

Step 2: Edit the default Redmine configuration

$ helm edit redmine

Here you can update the MariaDB root password, Redmine admin username, password, email address and language in tpl/values.toml. When not specified, the default values are:

  • mariadbPassword: bitnami
  • redmineUser: user
  • redminePassword: bitnami
  • redmineEmail: user@example.com
  • redmineLanguage: en

The values of redmineUser and redminePassword are the login credentials when you access the Redmine instance.

Note:

If you had updated the MariaDB root password for the MariaDB deployment, then ensure you set the same password for the mariadbPassword field in the Redmine chart.

If you had setup a GCE PD, you will need to update the tpl/mariadb-controller.yaml as well.

Replace:

      volumes:
      - name: data
        emptyDir: {}

with

      volumes:
      - name: data
        gcePersistentDisk:
          pdName: redmine-data-disk
          fsType: ext4

Step 3: Generate the chart

$ helm generate redmine

The above command will generate the Redmine chart with your changes from the last step.

Step 4: Deploy Redmine

$ helm install redmine

In the above command, Helm will deploy the Redmine chart in the cluster.

Note:

On GKE, the above command will automatically configure a firewall rule so that the Redmine instance is accessible from the internet, for which you will be charged additionally.

On other cloud platforms you may have to setup a firewall rule manually. Please refer your cloud providers documentation.

The deployment status of the Redmine pods can be checked with kubectl using:

$ kubectl get pods -l app=redmine
NAME            READY     STATUS    RESTARTS   AGE
redmine-b3jld   1/1       Running   0          1m

Access your Redmine application

You should now be able to access the application using the external IP configured for the Redmine service.

In the case of GKE, get the external IP address of your Redmine instance using:

$ kubectl get services redmine
NAME      CLUSTER_IP      EXTERNAL_IP       PORT(S)   SELECTOR      AGE
redmine   10.99.240.185   104.197.156.125   80/TCP    app=redmine   3m

Access your Redmine deployment using the IP address listed under the EXTERNAL_IP column.

Cleanup

To delete the Redmine deployment completely:

  1. Uninstall the Redmine Chart:
$ helm uninstall -n default redmine
  1. Uninstall the MariaDB Chart:
$ helm uninstall -n default mariadb
  1. Delete the disks:
$ gcloud compute disks delete redmine-data-disk
  1. Delete your cluster:
$ gcloud container clusters delete my-cluster