Skip to content

Commit ab3a98c

Browse files
tompizmorprydonius
authored andcommitted
Add PostgreSQL support to Redmine chart (helm#1089)
* Add postgresql database support to redmine chart * add default values for database types in the README * Update Redmine chart version * Explain PostgreSQL usage
1 parent f357b77 commit ab3a98c

File tree

7 files changed

+83
-12
lines changed

7 files changed

+83
-12
lines changed

stable/redmine/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: redmine
2-
version: 0.4.3
2+
version: 1.0.0
33
description: A flexible project management web application.
44
keywords:
55
- redmine

stable/redmine/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $ helm install stable/redmine
1212

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

15-
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 Redmine application.
15+
It also packages the [Bitnami MariaDB chart](https://github.com/kubernetes/charts/tree/master/stable/mariadb) and the [PostgreSQL chart](https://github.com/kubernetes/charts/tree/master/stable/postgresql) which are required for bootstrapping a MariaDB/PostgreSQL deployment for the database requirements of the Redmine application.
1616

1717
## Prerequisites
1818

@@ -41,6 +41,14 @@ $ helm delete my-release
4141

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

44+
## Using PostgreSQL instead of MariaDB
45+
46+
This chart includes the option to use a PostgreSQL database for Redmine instead of MariaDB. To use this, MariaDB must be explicitly disabled and PostgreSQL enabled:
47+
48+
```
49+
helm install --name my-release stable/redmine --set databaseType.mariadb=false,databaseType.postgresql=true
50+
```
51+
4452
## Configuration
4553

4654
The following tables lists the configurable parameters of the Redmine chart and their default values.
@@ -58,7 +66,10 @@ The following tables lists the configurable parameters of the Redmine chart and
5866
| `smtpUser` | SMTP user | `nil` |
5967
| `smtpPassword` | SMTP password | `nil` |
6068
| `smtpTls` | Use TLS encryption with SMTP | `nil` |
69+
| `databaseType.postgresql` | Select postgresql database | `false` |
70+
| `databaseType.mariadb` | Select mariadb database | `true` |
6171
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` |
72+
| `postgresql.postgresqlPassword` | PostgreSQL admin password | `nil` |
6273
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
6374
| `persistence.enabled` | Enable persistence using PVC | `true` |
6475
| `persistence.existingClaim` | The name of an existing PVC | `nil` |
@@ -106,4 +117,3 @@ The following example includes two PVCs, one for redmine and another for Maria D
106117
```bash
107118
$ helm install --name test --set persistence.existingClaim=PVC_REDMINE,mariadb.persistence.existingClaim=PVC_MARIADB redmine
108119
```
109-

stable/redmine/requirements.lock

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
dependencies:
22
- condition: ""
33
enabled: false
4+
import-values: null
45
name: mariadb
56
repository: https://kubernetes-charts.storage.googleapis.com/
67
tags: null
78
version: 0.6.0
8-
digest: sha256:b4e89d834d107108f60c64c1c679a10798334ea7bb385a1a55080d802e2a9067
9-
generated: 2017-04-05T14:30:13.450057849-04:00
9+
- condition: ""
10+
enabled: false
11+
import-values: null
12+
name: postgresql
13+
repository: https://kubernetes-charts.storage.googleapis.com/
14+
tags: null
15+
version: 0.6.0
16+
digest: sha256:38221d834fb6dc8d5f067bf2af4f5810e8224e3cfd6531ca24588d761bb37082
17+
generated: 2017-05-04T15:43:43.465748774+02:00

stable/redmine/requirements.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ dependencies:
22
- name: mariadb
33
version: 0.6.0
44
repository: https://kubernetes-charts.storage.googleapis.com/
5+
condition: databaseType.mariadb
6+
- name: postgresql
7+
version: 0.6.0
8+
repository: https://kubernetes-charts.storage.googleapis.com/
9+
condition: databaseType.postgresql

stable/redmine/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
2323
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
2424
{{- end -}}
2525

26+
{{/*
27+
Create a default fully qualified app name.
28+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
29+
*/}}
30+
{{- define "postgresql.fullname" -}}
31+
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}

stable/redmine/templates/deployment.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,23 @@ spec:
1919
image: "{{ .Values.image }}"
2020
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
2121
env:
22-
- name: MARIADB_HOST
22+
{{ if .Values.databaseType.postgresql }}
23+
- name: REDMINE_DB_POSTGRES
24+
value: {{ template "postgresql.fullname" . }}
25+
- name: REDMINE_DB_PASSWORD
26+
valueFrom:
27+
secretKeyRef:
28+
name: {{ template "postgresql.fullname" . }}
29+
key: postgres-password
30+
{{ else }}
31+
- name: REDMINE_DB_MYSQL
2332
value: {{ template "mariadb.fullname" . }}
24-
- name: MARIADB_PORT
25-
value: "3306"
26-
- name: MARIADB_PASSWORD
33+
- name: REDMINE_DB_PASSWORD
2734
valueFrom:
2835
secretKeyRef:
2936
name: {{ template "mariadb.fullname" . }}
3037
key: mariadb-root-password
38+
{{ end }}
3139
- name: REDMINE_USERNAME
3240
value: {{ default "" .Values.redmineUsername | quote }}
3341
- name: REDMINE_PASSWORD

stable/redmine/values.yaml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Bitnami Redmine image version
22
## ref: https://hub.docker.com/r/bitnami/redmine/tags/
33
##
4-
image: bitnami/redmine:3.3.3-r1
4+
image: bitnami/redmine:3.3.3-r2
55

66
## Specify a imagePullPolicy
77
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -38,6 +38,13 @@ redmineLanguage: en
3838
# smtpPassword:
3939
# smtpTls:
4040

41+
## Database configuration. Please note that only one of the following databases should be selected.
42+
## ref: https://github.com/bitnami/bitnami-docker-redmine#run-the-application-using-postgresql-database
43+
##
44+
databaseType:
45+
mariadb: true
46+
postgresql: false
47+
4148
##
4249
## MariaDB chart configuration
4350
##
@@ -55,7 +62,33 @@ mariadb:
5562
## A manually manage Persistent Volume Claim
5663
## Requires mariadb.persistence.enable: true
5764
## If defined, PVC must be created manually before volume will be bound
58-
# existingClaim:
65+
# existingClaim:
66+
67+
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
68+
## Default: volume.alpha.kubernetes.io/storage-class: default
69+
##
70+
# storageClass:
71+
accessMode: ReadWriteOnce
72+
size: 8Gi
73+
74+
##
75+
## PostgreSQL chart configuration
76+
##
77+
postgresql:
78+
## PostgreSQL admin password
79+
## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#setting-the-root-password-on-first-run
80+
##
81+
# postgresqlPassword:
82+
83+
## Enable persistence using Persistent Volume Claims
84+
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
85+
##
86+
persistence:
87+
enabled: true
88+
## A manually manage Persistent Volume Claim
89+
## Requires postgresql.persistence.enable: true
90+
## If defined, PVC must be created manually before volume will be bound
91+
# existingClaim:
5992

6093
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
6194
## Default: volume.alpha.kubernetes.io/storage-class: default
@@ -77,7 +110,7 @@ persistence:
77110
## A manually manage Persistent Volume Claim
78111
## Requires persistence.enable: true
79112
## If defined, PVC must be created manually before volume will be bound
80-
# existingClaim:
113+
# existingClaim:
81114

82115
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
83116
## Default: volume.alpha.kubernetes.io/storage-class: default

0 commit comments

Comments
 (0)