diff --git a/Chart.yaml b/Chart.yaml index af543ce..1ebc973 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -34,3 +34,4 @@ dependencies: - name: redis version: 16.13.2 repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami + condition: redis.enabled diff --git a/templates/configmap-env.yaml b/templates/configmap-env.yaml index 4d01955..60efedd 100644 --- a/templates/configmap-env.yaml +++ b/templates/configmap-env.yaml @@ -35,8 +35,12 @@ data: MALLOC_ARENA_MAX: "2" NODE_ENV: "production" RAILS_ENV: "production" + {{- if .Values.redis.enabled }} REDIS_HOST: {{ template "mastodon.redis.fullname" . }}-master - REDIS_PORT: "6379" + {{- else }} + REDIS_HOST: {{ required "When the redis chart is disabled .Values.redis.hostname is required" .Values.redis.hostname }} + {{- end }} + REDIS_PORT: {{ .Values.redis.port | default "6379" | quote }} {{- if .Values.mastodon.s3.enabled }} S3_BUCKET: {{ .Values.mastodon.s3.bucket }} S3_ENABLED: "true" diff --git a/values.yaml b/values.yaml index 09f6549..0b926b8 100644 --- a/values.yaml +++ b/values.yaml @@ -256,6 +256,11 @@ postgresql: # https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters redis: + # disable if you want to use an existing redis instance; in which case the + # values below must match those of that external redis instance + enabled: true + hostname: "" + port: 6379 # -- you must set a password; the password generated by the redis chart will be # rotated on each upgrade: password: ""