[stable/redis] Add support to execute Redis as root (#15276)

* [stable/redis] Add support to execute Redis as root

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>

* Change Redis hardcoded data directory to the value at the Values.yaml when changing permissions deploying as root

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2019-07-08 03:22:34 -07:00
committed by Kubernetes Prow Robot
parent ab908807e4
commit 1052ccf663
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: redis
version: 8.0.18
version: 8.0.19
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:
@@ -68,6 +68,10 @@ spec:
- /bin/bash
- -c
- |
{{- if (eq .Values.securityContext.runAsUser 0.0) }}
useradd redis
chown -R redis {{ .Values.master.persistence.path }}
{{- end }}
if [[ -n $REDIS_PASSWORD_FILE ]]; then
password_aux=`cat ${REDIS_PASSWORD_FILE}`
export REDIS_PASSWORD=$password_aux
@@ -76,6 +76,10 @@ spec:
- /bin/bash
- -c
- |
{{- if (eq .Values.securityContext.runAsUser 0.0) }}
useradd redis
chown -R redis {{ .Values.slave.persistence.path }}
{{- end }}
if [[ -n $REDIS_PASSWORD_FILE ]]; then
password_aux=`cat ${REDIS_PASSWORD_FILE}`
export REDIS_PASSWORD=$password_aux