From 0b010d93bf6270cd219f672ff9f527454b2155aa Mon Sep 17 00:00:00 2001 From: Cedric Thiebault Date: Mon, 1 Jul 2019 22:40:37 +0200 Subject: [PATCH] [stable/nexcloud] Support PostgreSQL database (#15155) Signed-off-by: Cedric Thiebault --- stable/nextcloud/Chart.yaml | 2 +- stable/nextcloud/README.md | 1 + stable/nextcloud/templates/deployment.yaml | 17 +++++++++++++++++ stable/nextcloud/values.yaml | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/stable/nextcloud/Chart.yaml b/stable/nextcloud/Chart.yaml index f91658d47c..fa30d50882 100644 --- a/stable/nextcloud/Chart.yaml +++ b/stable/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: nextcloud -version: 1.4.0 +version: 1.5.0 appVersion: 16.0.1 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/stable/nextcloud/README.md b/stable/nextcloud/README.md index 09c7c73f86..fbb0e2eedf 100644 --- a/stable/nextcloud/README.md +++ b/stable/nextcloud/README.md @@ -73,6 +73,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `internalDatabase.enabled` | Whether to use internal sqlite database | `true` | | `internalDatabase.database` | Name of the existing database | `nextcloud` | | `externalDatabase.enabled` | Whether to use external database | `false` | +| `externalDatabase.type` | External database type: `mysql`, `postgresql` | `mysql` | | `externalDatabase.host` | Host of the external database | `nil` | | `externalDatabase.database` | Name of the existing database | `nextcloud` | | `externalDatabase.user` | Existing username in the external db | `nextcloud` | diff --git a/stable/nextcloud/templates/deployment.yaml b/stable/nextcloud/templates/deployment.yaml index 6e0439fae1..75044fa253 100644 --- a/stable/nextcloud/templates/deployment.yaml +++ b/stable/nextcloud/templates/deployment.yaml @@ -51,6 +51,22 @@ spec: name: {{ printf "%s-%s" .Release.Name "db" }} key: db-password {{- else }} + {{- if eq .Values.externalDatabase.type "postgresql" }} + - name: POSTGRES_HOST + value: {{ .Values.externalDatabase.host | quote }} + - name: POSTGRES_DB + value: {{ .Values.externalDatabase.database | quote }} + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: {{ printf "%s-%s" .Release.Name "db" }} + key: db-username + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: {{ printf "%s-%s" .Release.Name "db" }} + key: db-password + {{- else }} - name: MYSQL_HOST value: {{ .Values.externalDatabase.host | quote }} - name: MYSQL_DATABASE @@ -65,6 +81,7 @@ spec: secretKeyRef: name: {{ printf "%s-%s" .Release.Name "db" }} key: db-password + {{- end }} {{- end }} - name: NEXTCLOUD_ADMIN_USER valueFrom: diff --git a/stable/nextcloud/values.yaml b/stable/nextcloud/values.yaml index 1501fac4af..d664ced68d 100644 --- a/stable/nextcloud/values.yaml +++ b/stable/nextcloud/values.yaml @@ -86,6 +86,9 @@ internalDatabase: externalDatabase: enabled: false + ## Supported database engines: mysql or postgresql + type: mysql + ## Database host host: