Skip to content

Commit 78cc1e1

Browse files
tompizmorprydonius
authored andcommitted
[stable/drupal] allow use of external database (helm#2817)
* Allow Drupal helm chart to use an existing database * Do not deploy mariadb chart if using external database * Add new properties to README * Refactor properties to configure an external database * Update dependencies
1 parent 1c8529b commit 78cc1e1

File tree

6 files changed

+80
-6
lines changed

6 files changed

+80
-6
lines changed

stable/drupal/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: drupal
2-
version: 0.10.4
2+
version: 0.11.0
33
appVersion: 8.4.2
44
description: One of the most versatile open source content management systems.
55
keywords:

stable/drupal/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,21 @@ The following tables lists the configurable parameters of the Drupal chart and t
5353
| `drupalUsername` | User of the application | `user` |
5454
| `drupalPassword` | Application password | _random 10 character long alphanumeric string_ |
5555
| `drupalEmail` | Admin email | `user@example.com` |
56+
| `allowEmptyPassword` | Allow DB blank passwords | `yes` |
5657
| `extraVars` | Extra environment variables | `nil` |
5758
| `ingress.annotations` | Specify ingress class | `kubernetes.io/ingress.class: nginx` |
5859
| `ingress.enabled` | Enable ingress controller resource | `false` |
5960
| `ingress.hostname` | URL for your Drupal installation | `drupal.local` |
6061
| `ingress.tls` | Ingress TLS configuration | `[]` |
62+
| `externalDatabase.host` | Host of the external database | `nil` |
63+
| `externalDatabase.user` | Existing username in the external db | `bn_drupal` |
64+
| `externalDatabase.password` | Password for the above username | `nil` |
65+
| `externalDatabase.database` | Name of the existing databse | `bitnami_drupal` |
66+
| `mariadb.enabled` | Use or not the mariadb chart | `true` |
6167
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` |
68+
| `mariadb.mariadbDatabase` | Database name to create | `bitnami_drupal` |
69+
| `mariadb.mariadbUser` | Database user to create | `bn_drupal` |
70+
| `mariadb.mariadbPassword` | Password for the database | _random 10 character long alphanumeric string_ |
6271
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
6372
| `persistence.enabled` | Enable persistence using PVC | `true` |
6473
| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) |

stable/drupal/requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ dependencies:
22
- name: mariadb
33
repository: https://kubernetes-charts.storage.googleapis.com/
44
version: 1.0.5
5-
digest: sha256:08de643d4a3b2886a76b7f5da8ea7db20b7a69b8de1d04594862adfe4735993c
6-
generated: 2017-10-03T10:05:16.672603874+08:00
5+
digest: sha256:784a2dfb3f8c0a334cfb6dd31381ea39bd5a3834f12d95f24aa074be558388e1
6+
generated: 2017-12-05T17:15:55.281989+01:00

stable/drupal/requirements.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ dependencies:
22
- name: mariadb
33
version: 1.0.5
44
repository: https://kubernetes-charts.storage.googleapis.com/
5+
condition: mariadb.enabled

stable/drupal/templates/deployment.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,41 @@ spec:
1919
image: "{{ .Values.image }}"
2020
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
2121
env:
22+
- name: ALLOW_EMPTY_PASSWORD
23+
{{- if .Values.allowEmptyPassword }}
24+
value: "yes"
25+
{{- else }}
26+
value: "no"
27+
{{- end }}
2228
- name: MARIADB_HOST
29+
{{- if .Values.mariadb.enabled }}
2330
value: {{ template "drupal.mariadb.fullname" . }}
31+
{{- else }}
32+
value: {{ default "" .Values.externalDatabase.host | quote }}
33+
{{- end }}
2434
- name: MARIADB_PORT_NUMBER
2535
value: "3306"
26-
- name: MARIADB_PASSWORD
36+
- name: DRUPAL_DATABASE_NAME
37+
{{- if .Values.mariadb.enabled }}
38+
value: {{ default "" .Values.mariadb.mariadbDatabase | quote }}
39+
{{- else }}
40+
value: {{ default "" .Values.externalDatabase.database | quote }}
41+
{{- end }}
42+
- name: DRUPAL_DATABASE_USER
43+
{{- if .Values.mariadb.enabled }}
44+
value: {{ default "" .Values.mariadb.mariadbUser | quote }}
45+
{{- else }}
46+
value: {{ default "" .Values.externalDatabase.user | quote }}
47+
{{- end }}
48+
- name: DRUPAL_DATABASE_PASSWORD
49+
{{- if .Values.mariadb.enabled }}
2750
valueFrom:
2851
secretKeyRef:
2952
name: {{ template "drupal.mariadb.fullname" . }}
30-
key: mariadb-root-password
53+
key: mariadb-password
54+
{{- else }}
55+
value: {{ default "" .Values.externalDatabase.password | quote }}
56+
{{- end }}
3157
- name: DRUPAL_USERNAME
3258
value: {{ default "" .Values.drupalUsername | quote }}
3359
- name: DRUPAL_PASSWORD

stable/drupal/values.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Bitnami Drupal image version
22
## ref: https://hub.docker.com/r/bitnami/drupal/tags/
33
##
4-
image: bitnami/drupal:8.4.2-r0
4+
image: bitnami/drupal:8.4.2-r1
55

66
## Optionally specify an array of imagePullSecrets.
77
## Secrets must be manually created in the namespace.
@@ -31,15 +31,53 @@ drupalUsername: user
3131
##
3232
drupalEmail: user@example.com
3333

34+
## Set to `yes` to allow the container to be started with blank passwords
35+
## ref: https://github.com/bitnami/bitnami-docker-wordpress#environment-variables
36+
allowEmptyPassword: yes
37+
38+
##
39+
## External database configuration
40+
##
41+
externalDatabase:
42+
## Database host
43+
# host:
44+
45+
## Database user
46+
# user: bn_drupal
47+
48+
## Database password
49+
# password:
50+
51+
## Database name
52+
# database: bitnami_drupal
53+
3454
##
3555
## MariaDB chart configuration
3656
##
3757
mariadb:
58+
## Whether to use the database specified as a requirement or not. For example, to configure the chart with an existing database server.
59+
enabled: true
60+
3861
## MariaDB admin password
3962
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run
4063
##
4164
# mariadbRootPassword:
4265

66+
## Create a database
67+
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-on-first-run
68+
##
69+
mariadbDatabase: bitnami_drupal
70+
71+
## Create a database user
72+
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
73+
##
74+
mariadbUser: bn_drupal
75+
76+
## Password for mariadbUser
77+
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
78+
##
79+
# mariadbPassword:
80+
4381
## Enable persistence using Persistent Volume Claims
4482
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
4583
##

0 commit comments

Comments
 (0)