Commit eb3c7a6a authored by Waqar Ahmed's avatar Waqar Ahmed

Initial postgres support

parent 918fbb09
...@@ -7,8 +7,8 @@ groups: ...@@ -7,8 +7,8 @@ groups:
description: "Configure Storage for Nextcloud" description: "Configure Storage for Nextcloud"
- name: "Container Configuration" - name: "Container Configuration"
description: "Configure nextcloud container parameters" description: "Configure nextcloud container parameters"
- name: "Nginx Configuration" - name: "Postgresql Configuration"
description: "Use nginx with Nextcloud" description: "Configure Postgresql for nextcloud"
questions: questions:
# Image related # Image related
...@@ -165,14 +165,6 @@ questions: ...@@ -165,14 +165,6 @@ questions:
additional_attrs: true additional_attrs: true
attrs: [] attrs: []
- variable: nginx
label: "Configure Nginx"
group: "Nginx Configuration"
schema:
type: dict
additional_attrs: true
attrs: []
- variable: internalDatabase - variable: internalDatabase
label: "REMOVEME" label: "REMOVEME"
schema: schema:
...@@ -188,11 +180,50 @@ questions: ...@@ -188,11 +180,50 @@ questions:
attrs: [] attrs: []
- variable: postgresql - variable: postgresql
label: "REMOVEME" label: "Configure Postgresql"
group: "Postgresql Configuration"
schema: schema:
type: dict type: dict
additional_attrs: true additional_attrs: true
attrs: [] attrs:
- variable: backupVolume
label: "Backup Volume"
schema:
type: dict
$ref:
- "normalize/ixVolume"
attrs:
- variable: mountPath
label: "Mount Path"
schema:
type: path
editable: false
default: "/postgres_backups"
- variable: datasetName
label: "Dataset Name"
schema:
type: string
default: "ix-postgres_backups"
editable: false
- variable: dataVolume
label: "Postgresql Data Volume"
schema:
type: dict
$ref:
- "normalize/ixVolume"
attrs:
- variable: mountPath
label: "Mount Path"
schema:
type: path
editable: false
default: "/var/lib/postgresql/data"
- variable: datasetName
label: "Dataset Name"
schema:
type: string
default: "ix-postgres_data"
editable: false
- variable: cronjob - variable: cronjob
label: "REMOVEME" label: "REMOVEME"
......
...@@ -61,3 +61,19 @@ Retrieve host path defined in volume ...@@ -61,3 +61,19 @@ Retrieve host path defined in volume
{{- printf "" -}} {{- printf "" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/*
Selector labels
*/}}
{{- define "nextcloud.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Postgres Selector labels
*/}}
{{- define "nextcloud.postgres.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres
app.kubernetes.io/instance: {{ .Release.Name }}-postgres
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "nextcloud.fullname" . }}-postgres
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: app
spec:
type: ClusterIP
ports:
- port: 5432
protocol: TCP
name: postgres-tcp
selector:
{{- include "nextcloud.postgres.selectorLabels" . | nindent 4 }}
...@@ -17,4 +17,4 @@ spec: ...@@ -17,4 +17,4 @@ spec:
name: http name: http
nodePort: {{ default "" .Values.service.nodePort}} nodePort: {{ default "" .Values.service.nodePort}}
selector: selector:
app.kubernetes.io/name: {{ include "nextcloud.name" . }} {{- include "nextcloud.selectorLabels" . | nindent 4 }}
...@@ -113,34 +113,18 @@ nextcloud: ...@@ -113,34 +113,18 @@ nextcloud:
# - name: nfs # - name: nfs
# mountPath: "/legacy_data" # mountPath: "/legacy_data"
nginx:
## You need to set an fpm version of the image for nextcloud if you want to use nginx!
enabled: false
image:
repository: nginx
tag: alpine
pullPolicy: IfNotPresent
config:
# This generates the default nginx config as per the nextcloud documentation
default: true
# custom: |-
# worker_processes 1;..
resources: {}
internalDatabase: internalDatabase:
enabled: true enabled: false
name: nextcloud name: nextcloud
## ##
## External database configuration ## External database configuration
## ##
externalDatabase: externalDatabase:
enabled: false enabled: true
## Supported database engines: mysql or postgresql ## Supported database engines: mysql or postgresql
type: mysql type: postgresql
## Database host ## Database host
host: host:
...@@ -162,15 +146,7 @@ externalDatabase: ...@@ -162,15 +146,7 @@ externalDatabase:
# passwordKey: password # passwordKey: password
postgresql: postgresql:
enabled: false host:
global:
postgresql:
postgresqlUsername: nextcloud
postgresqlPassword: changeme
postgresqlDatabase: nextcloud
persistence:
enabled: false
# storageClass: ""
## Cronjob to execute Nextcloud background tasks ## Cronjob to execute Nextcloud background tasks
## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron ## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment