diff --git a/upstreamed/redis/Chart.yaml b/upstreamed/redis/Chart.yaml index 4ad40aef3..551b24ccb 100644 --- a/upstreamed/redis/Chart.yaml +++ b/upstreamed/redis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redis -version: 9.1.12 +version: 9.2.0 appVersion: 5.0.5 description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. keywords: diff --git a/upstreamed/redis/README.md b/upstreamed/redis/README.md index 0044cef8b..75ea55771 100644 --- a/upstreamed/redis/README.md +++ b/upstreamed/redis/README.md @@ -137,6 +137,7 @@ The following table lists the configurable parameters of the Redis chart and the | `cluster.enabled` | Use master-slave topology | `true` | | `cluster.slaveCount` | Number of slaves | `1` | | `existingSecret` | Name of existing secret object (for password authentication) | `nil` | +| `existingSecretPasswordKey` | Name of key containing password to be retrieved from the existing secret | `nil` | | `usePassword` | Use password | `true` | | `usePasswordFile` | Mount passwords as files instead of environment variables | `false` | | `password` | Redis password (ignored if existingSecret set) | Randomly generated | diff --git a/upstreamed/redis/ci/production-sentinel-values.yaml b/upstreamed/redis/ci/production-sentinel-values.yaml index 9925c0c5d..c230a5655 100644 --- a/upstreamed/redis/ci/production-sentinel-values.yaml +++ b/upstreamed/redis/ci/production-sentinel-values.yaml @@ -163,6 +163,9 @@ usePassword: true password: ## Use existing secret (ignores previous password) # existingSecret: +## Password key to be retrieved from Redis secret +## +# existingSecretPasswordKey: ## Mount secrets as files instead of environment variables usePasswordFile: false diff --git a/upstreamed/redis/ci/production-values.yaml b/upstreamed/redis/ci/production-values.yaml index cd6ed864c..29f715366 100644 --- a/upstreamed/redis/ci/production-values.yaml +++ b/upstreamed/redis/ci/production-values.yaml @@ -163,6 +163,9 @@ usePassword: true password: ## Use existing secret (ignores previous password) # existingSecret: +## Password key to be retrieved from Redis secret +## +# existingSecretPasswordKey: ## Mount secrets as files instead of environment variables usePasswordFile: false diff --git a/upstreamed/redis/templates/_helpers.tpl b/upstreamed/redis/templates/_helpers.tpl index 981e074a3..be47dd881 100644 --- a/upstreamed/redis/templates/_helpers.tpl +++ b/upstreamed/redis/templates/_helpers.tpl @@ -156,6 +156,17 @@ Get the password secret. {{- end -}} {{- end -}} +{{/* +Get the password key to be retrieved from Redis secret. +*/}} +{{- define "redis.secretPasswordKey" -}} +{{- if and .Values.existingSecret .Values.existingSecretPasswordKey -}} +{{- printf "%s" .Values.existingSecretPasswordKey -}} +{{- else -}} +{{- printf "redis-password" -}} +{{- end -}} +{{- end -}} + {{/* Return sysctl image */}} diff --git a/upstreamed/redis/templates/redis-master-statefulset.yaml b/upstreamed/redis/templates/redis-master-statefulset.yaml index 656385098..66254ff20 100644 --- a/upstreamed/redis/templates/redis-master-statefulset.yaml +++ b/upstreamed/redis/templates/redis-master-statefulset.yaml @@ -119,7 +119,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} {{- else }} - name: ALLOW_EMPTY_PASSWORD @@ -210,7 +210,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} {{- else }} - name: ALLOW_EMPTY_PASSWORD @@ -288,7 +288,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} volumeMounts: {{- if .Values.usePasswordFile }} @@ -345,6 +345,9 @@ spec: - name: redis-password secret: secretName: {{ template "redis.secretName" . }} + items: + - key: {{ template "redis.secretPasswordKey" . }} + path: redis-password {{- end }} - name: config configMap: diff --git a/upstreamed/redis/templates/redis-slave-statefulset.yaml b/upstreamed/redis/templates/redis-slave-statefulset.yaml index 43e4046f9..43a67895d 100644 --- a/upstreamed/redis/templates/redis-slave-statefulset.yaml +++ b/upstreamed/redis/templates/redis-slave-statefulset.yaml @@ -138,12 +138,12 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} - name: REDIS_MASTER_PASSWORD valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} {{- else }} - name: ALLOW_EMPTY_PASSWORD @@ -236,7 +236,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} {{- else }} - name: ALLOW_EMPTY_PASSWORD @@ -314,7 +314,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "redis.secretName" . }} - key: redis-password + key: {{ template "redis.secretPasswordKey" . }} {{- end }} volumeMounts: {{- if .Values.usePasswordFile }} @@ -371,6 +371,9 @@ spec: - name: redis-password secret: secretName: {{ template "redis.secretName" . }} + items: + - key: {{ template "redis.secretPasswordKey" . }} + path: redis-password {{- end }} - name: config configMap: diff --git a/upstreamed/redis/values-production.yaml b/upstreamed/redis/values-production.yaml index be61f6d73..f737b823a 100644 --- a/upstreamed/redis/values-production.yaml +++ b/upstreamed/redis/values-production.yaml @@ -179,6 +179,9 @@ usePassword: true password: ## Use existing secret (ignores previous password) # existingSecret: +## Password key to be retrieved from Redis secret +## +# existingSecretPasswordKey: ## Mount secrets as files instead of environment variables usePasswordFile: false diff --git a/upstreamed/redis/values.yaml b/upstreamed/redis/values.yaml index 4b9f30a96..85c954132 100644 --- a/upstreamed/redis/values.yaml +++ b/upstreamed/redis/values.yaml @@ -179,6 +179,9 @@ usePassword: true password: ## Use existing secret (ignores previous password) # existingSecret: +## Password key to be retrieved from Redis secret +## +# existingSecretPasswordKey: ## Mount secrets as files instead of environment variables usePasswordFile: false