diff --git a/charts/funkwhale/Chart.yaml b/charts/funkwhale/Chart.yaml index f789b18..0b9dda7 100644 --- a/charts/funkwhale/Chart.yaml +++ b/charts/funkwhale/Chart.yaml @@ -4,10 +4,14 @@ appVersion: "1.1.2" description: A social platform to enjoy and share music icon: https://funkwhale.audio/favicon.png name: funkwhale -version: 0.3.10 +version: 0.4.0 dependencies: - name: redis version: ~10.6.10 repository: https://charts.bitnami.com/bitnami condition: redis.enabled +- name: postgresql + version: ~10.9.4 + repository: https://charts.bitnami.com/bitnami + condition: postgresql.enabled diff --git a/charts/funkwhale/templates/_helpers.tpl b/charts/funkwhale/templates/_helpers.tpl index 5bf807d..ed5479f 100644 --- a/charts/funkwhale/templates/_helpers.tpl +++ b/charts/funkwhale/templates/_helpers.tpl @@ -7,7 +7,19 @@ Expand the name of the chart. {{- end -}} {{- 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 -}} + +{{- if .Values.database.user -}} +{{ fail "You are using the old database config key - please migrate to the new postgresql config key" }} {{- end -}} {{/* diff --git a/charts/funkwhale/values.yaml b/charts/funkwhale/values.yaml index c2b06f6..80ffe6a 100644 --- a/charts/funkwhale/values.yaml +++ b/charts/funkwhale/values.yaml @@ -30,21 +30,31 @@ ingress: # hosts: # - 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 - host: - - ## Database port - port: 5432 + host: "" ## Database user - user: funkwhale + postgresqlUsername: postgres ## Database password - password: + postgresqlPassword: funkwhale + + ## Database password + postgresqlDatabase: funkwhale + + ## Database port + service: + port: 5432 - ## Database name - database: funkwhale + persistence: + enabled: true + # storageClass: "" + # size: 8Gi redis: # If you already have a Redis service you'd like to use, set @@ -240,4 +250,3 @@ celery: # operator: In # values: # - app -