From d5edbeb73eeb8a00c7296377fc3d24e675b79bd6 Mon Sep 17 00:00:00 2001 From: Jeremiah Lee <106775223+jeremiahlee@users.noreply.github.com> Date: Wed, 19 Jul 2023 19:57:38 +0200 Subject: [PATCH] Add existing Redis instance password to new Secret Store an external, existing Redis instance password in a Secret via the values.yaml in the same way an existing postgresql.auth.password value gets stored in a Secret. Fixes mastodon/chart#80 --- templates/secret-redis.yaml | 15 +++++++++++++++ values.yaml | 1 + 2 files changed, 16 insertions(+) create mode 100644 templates/secret-redis.yaml diff --git a/templates/secret-redis.yaml b/templates/secret-redis.yaml new file mode 100644 index 0000000..b1d8ac1 --- /dev/null +++ b/templates/secret-redis.yaml @@ -0,0 +1,15 @@ +{{- if not .Values.redis.enabled }} +{{- if and (not .Values.redis.auth.existingSecret) (not .Values.redis.existingSecret) }} +{{- if .Values.redis.auth.password }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "mastodon.redis.secretName" . }} + labels: + {{- include "mastodon.labels" . | nindent 4 }} +type: Opaque +data: + redis-password: "{{ .Values.redis.auth.password | b64enc }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/values.yaml b/values.yaml index a4660e2..eec1e19 100644 --- a/values.yaml +++ b/values.yaml @@ -278,6 +278,7 @@ redis: # -- you must set a password; the password generated by the redis chart will be # rotated on each upgrade: password: "" + # setting password for an existing redis instance will store it in a new Secret # you can also specify the name of an existing Secret # with a key of redis-password set to the password you want # existingSecret: ""