Add Bitnami Postgresql subchart

This commit is contained in:
Jonathan Gazeley 2021-09-13 21:38:13 +01:00
parent 95632ef2f8
commit 82dda7a136
3 changed files with 33 additions and 12 deletions

View file

@ -4,10 +4,14 @@ appVersion: "1.1.2"
description: A social platform to enjoy and share music description: A social platform to enjoy and share music
icon: https://funkwhale.audio/favicon.png icon: https://funkwhale.audio/favicon.png
name: funkwhale name: funkwhale
version: 0.3.10 version: 0.4.0
dependencies: dependencies:
- name: redis - name: redis
version: ~10.6.10 version: ~10.6.10
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
condition: redis.enabled condition: redis.enabled
- name: postgresql
version: ~10.9.4
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled

View file

@ -7,7 +7,15 @@ Expand the name of the chart.
{{- end -}} {{- end -}}
{{- define "funkwhale.dbUrl" -}} {{- define "funkwhale.dbUrl" -}}
postgres://{{ .Values.database.user }}:{{ .Values.database.password }}@{{ .Values.database.host }}:{{ .Values.database.port }}/{{ .Values.database.database }} {{- if and .Values.postgresql.enabled .Values.postgresql.host -}}
{{ fail "Setting both postgresql.enabled and postgresql.host will deploy an internal Postgres service and attempt to use an external one - please set only one of the two!" }}
{{- else if .Values.postgresql.enabled -}}
postgres://{{ .Values.postgresql.postgresqlUsername }}:{{ .Values.postgresql.postgresqlPassword }}@{{ template "funkwhale.fullname" . }}-postgresql:{{ .Values.postgresql.service.port }}/{{ .Values.postgresql.postgresqlDatabase }}
{{- else if .Values.postgresql.host -}}
postgres://{{ .Values.postgresql.postgresqlUsername }}:{{ .Values.postgresql.postgresqlPassword }}@{{ .Values.postgresql.host }}:{{ .Values.postgresql.service.port }}/{{ .Values.postgresql.postgresqlDatabase }}
{{- else -}}
{{ fail "Either postgresql.enabled or postgresql.host are required!" }}
{{- end -}}
{{- end -}} {{- end -}}
{{/* {{/*

View file

@ -30,21 +30,31 @@ ingress:
# hosts: # hosts:
# - chart-example.local # - chart-example.local
database: postgresql:
# If you already have a Postgresql service you'd like to use, set
# this to false and adjust the host to use your existing service.
enabled: true
## Database host ## Database host
host: host: ""
## Database port
port: 5432
## Database user ## Database user
user: funkwhale postgresqlUsername: postgres
## Database password ## Database password
password: postgresqlPassword: funkwhale
## Database password
postgresqlDatabase: funkwhale
## Database port
service:
port: 5432
## Database name persistence:
database: funkwhale enabled: false
# storageClass: ""
# size: 8Gi
redis: redis:
# If you already have a Redis service you'd like to use, set # If you already have a Redis service you'd like to use, set
@ -240,4 +250,3 @@ celery:
# operator: In # operator: In
# values: # values:
# - app # - app