From 543fdf7446a995c3c405b82071ec78b473521a26 Mon Sep 17 00:00:00 2001 From: Norman <85173861+norman-zon@users.noreply.github.com> Date: Thu, 1 Dec 2022 06:41:51 +0100 Subject: [PATCH] allow external redis instance (#6) --- Chart.yaml | 1 + templates/configmap-env.yaml | 6 +++++- values.yaml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 7080095..ad814a5 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 5d0b96d..c33296a 100644 --- a/templates/configmap-env.yaml +++ b/templates/configmap-env.yaml @@ -32,8 +32,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 07171fc..988c1d8 100644 --- a/values.yaml +++ b/values.yaml @@ -167,6 +167,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: ""