Merge branch 'allow-disabling-redis' into 'master'

Allow disabling the default Redis installation when a custom one is specified.

See merge request ananace/charts!3
This commit is contained in:
Alexander Olofsson 2021-03-23 10:22:15 +00:00
commit 2f628a29da
2 changed files with 13 additions and 4 deletions

View file

@ -10,3 +10,4 @@ dependencies:
- name: redis
version: ~10.6.10
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled

View file

@ -10,10 +10,6 @@ Expand the name of the chart.
postgres://{{ .Values.database.user }}:{{ .Values.database.password }}@{{ .Values.database.host }}:{{ .Values.database.port }}/{{ .Values.database.database }}
{{- end -}}
{{- define "funkwhale.redisUrl" -}}
redis://:{{ .Values.redis.password }}@{{ .Values.redis.host | default (printf "%s-%s" (include "funkwhale.fullname" .) "redis-master") }}:{{ .Values.redis.redisPort }}/0
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
@ -45,3 +41,15 @@ Create the correct image tag name
{{- define "funkwhale.imageTag" -}}
{{- .Values.image.tag | default .Chart.AppVersion -}}
{{- end -}}
{{- define "funkwhale.redisUrl" -}}
{{- if and .Values.redis.enabled .Values.redis.host -}}
{{ fail "Setting both redis.enabled and redis.host will deploy an internal Redis service and attempt to use an external one - please set only one of the two!" }}
{{- else if .Values.redis.enabled -}}
redis://:{{ .Values.redis.password }}@{{ template "funkwhale.fullname" . }}-redis-master:{{ .Values.redis.redisPort }}/0
{{- else if .Values.redis.host -}}
redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:{{ .Values.redis.redisPort }}/0
{{- else -}}
{{ fail "Either redis.enabled or redis.host are required!" }}
{{- end -}}
{{- end -}}