Skip to content

Commit

Permalink
add testlink chart (helm#189)
Browse files Browse the repository at this point in the history
* add testlink chart

* testlink: removed SMTP configuration options

* specify namespace in `kubectl get` command in NOTES.txt

* upgrade to `bitnami/testlink:1.9.14-r4`, reinstate SMTP config params
  • Loading branch information
Sameer Naik authored and Vic Iglesias committed Nov 16, 2016
1 parent 7e97163 commit 00456c0
Show file tree
Hide file tree
Showing 13 changed files with 420 additions and 0 deletions.
1 change: 1 addition & 0 deletions stable/testlink/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
15 changes: 15 additions & 0 deletions stable/testlink/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: testlink
version: 0.4.0
description: Web-based test management system that facilitates software quality assurance.
keywords:
- testlink
- testing
- http
- php
home: http://www.testlink.org/
sources:
- https://github.com/bitnami/bitnami-docker-testlink
maintainers:
- name: Bitnami
email: containers@bitnami.com
engine: gotpl
97 changes: 97 additions & 0 deletions stable/testlink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# TestLink

[TestLink](http://www.testlink.org) is a web-based test management system that facilitates software quality assurance. It is developed and maintained by Teamtest. The platform offers support for test cases, test suites, test plans, test projects and user management, as well as various reports and statistics.

## TL;DR;

```console
$ helm install stable/testlink
```

## Introduction

This chart bootstraps a [TestLink](https://github.com/bitnami/bitnami-docker-testlink) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

It also packages the [Bitnami MariaDB chart](https://github.com/kubernetes/charts/tree/master/stable/mariadb) which is required for bootstrapping a MariaDB deployment for the database requirements of the TestLink application.

## Prerequisites

- Kubernetes 1.4+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure

## Installing the Chart

To install the chart with the release name `my-release`:

```console
$ helm install --name my-release stable/testlink
```

The command deploys TestLink on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```console
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following tables lists the configurable parameters of the TestLink chart and their default values.

| Parameter | Description | Default |
|-------------------------------------|-----------------------------------------|---------------------------------------------------------|
| `image` | TestLink image | `bitnami/testlink:{VERSION}` |
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `testlinkUsername` | Admin username | `user` |
| `testlinkPassword` | Admin user password | _random 10 character long alphanumeric string_ |
| `testlinkEmail` | Admin user email | `user@example.com` |
| `smtpEnable` | Enable SMTP | `false` |
| `smtpHost` | SMTP host | `nil` |
| `smtpPort` | SMTP port | `nil` |
| `smtpUser` | SMTP user | `nil` |
| `smtpPassword` | SMTP password | `nil` |
| `smtpConnectionMode` | SMTP connection mode [`ssl`, `tls`] | `nil` |
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `generic` |
| `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` |
| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` |
| `persistence.testlink.storageClass` | PVC Storage Class for TestLink volume | `generic` |
| `persistence.testlink.accessMode` | PVC Access Mode for TestLink volume | `ReadWriteOnce` |
| `persistence.testlink.size` | PVC Storage Request for TestLink volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |

The above parameters map to the env variables defined in [bitnami/testlink](http://github.com/bitnami/bitnami-docker-testlink). For more information please refer to the [bitnami/testlink](http://github.com/bitnami/bitnami-docker-testlink) image documentation.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
$ helm install --name my-release \
--set testlinkUsername=admin,testlinkPassword=password,mariadb.mariadbRootPassword=secretpassword \
stable/testlink
```

The above command sets the TestLink administrator account username and password to `admin` and `password` respectively. Additionally it sets the MariaDB `root` user password to `secretpassword`.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

```console
$ helm install --name my-release -f values.yaml stable/testlink
```

> **Tip**: You can use the default [values.yaml](values.yaml)
## Persistence

The [Bitnami TestLink](https://github.com/bitnami/bitnami-docker-testlink) image stores the TestLink data and configurations at the `/bitnami/testlink` and `/bitnami/apache` paths of the container.

Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
See the [Configuration](#configuration) section to configure the PVC or to disable persistence.
6 changes: 6 additions & 0 deletions stable/testlink/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mariadb
repository: http://storage.googleapis.com/kubernetes-charts
version: 0.5.2
digest: sha256:400ac77ff2337dce024b0225bbfed9f509d77eb6ff6ee10000d59c5f6a367d51
generated: 2016-10-26T14:49:03.028344205-07:00
4 changes: 4 additions & 0 deletions stable/testlink/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: mariadb
version: 0.5.2
repository: http://storage.googleapis.com/kubernetes-charts
27 changes: 27 additions & 0 deletions stable/testlink/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

1. Get the TestLink URL by running:

{{- if contains "NodePort" .Values.serviceType }}

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/

{{- else if contains "LoadBalancer" .Values.serviceType }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- end }}

2. Get your TestLink login credentials by running:

echo Username: {{ .Values.testlinkUsername }}
echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.testlink-password[*]}"`))
24 changes: 24 additions & 0 deletions stable/testlink/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 24 -}}
{{- end -}}
14 changes: 14 additions & 0 deletions stable/testlink/templates/apache-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-apache
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.apache.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.apache.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.apache.size | quote }}
{{- end -}}
95 changes: 95 additions & 0 deletions stable/testlink/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
- name: MARIADB_HOST
value: {{ template "mariadb.fullname" . }}
- name: MARIADB_PORT
value: "3306"
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mariadb.fullname" . }}
key: mariadb-root-password
- name: TESTLINK_USERNAME
value: {{ default "" .Values.testlinkUsername | quote }}
- name: TESTLINK_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: testlink-password
- name: TESTLINK_EMAIL
value: {{ default "" .Values.testlinkEmail | quote }}
- name: TESTLINK_LANGUAGE
value: {{ default "" .Values.testlinkLanguage | quote }}
- name: SMTP_ENABLE
value: {{ default "" .Values.smtpEnable | quote }}
- name: SMTP_CONNECTION_MODE
value: {{ default "" .Values.smtpConnectionMode | quote }}
- name: SMTP_HOST
value: {{ default "" .Values.smtpHost | quote }}
- name: SMTP_PORT
value: {{ default "" .Values.smtpPort | quote }}
- name: SMTP_USER
value: {{ default "" .Values.smtpUser | quote }}
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: smtp-password
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 120
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
timeoutSeconds: 1
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: testlink-data
mountPath: /bitnami/testlink
- name: apache-data
mountPath: /bitnami/apache
volumes:
- name: testlink-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-testlink
{{- else }}
emptyDir: {}
{{- end }}
- name: apache-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-apache
{{- else }}
emptyDir: {}
{{- end }}
17 changes: 17 additions & 0 deletions stable/testlink/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{ if .Values.testlinkPassword }}
testlink-password: {{ .Values.testlinkPassword | b64enc | quote }}
{{ else }}
testlink-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }}
20 changes: 20 additions & 0 deletions stable/testlink/templates/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.serviceType }}
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
selector:
app: {{ template "fullname" . }}
14 changes: 14 additions & 0 deletions stable/testlink/templates/testlink-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-testlink
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.testlink.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.testlink.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.testlink.size | quote }}
{{- end -}}
Loading

0 comments on commit 00456c0

Please sign in to comment.