From 1b21c0fbf85d0c5b41640c01199c77d5d622321d Mon Sep 17 00:00:00 2001 From: "Miguel A. Cabrera Minagorri" Date: Fri, 5 Jul 2019 15:00:51 +0000 Subject: [PATCH] [stable/redis] Add support to execute Redis as root Signed-off-by: Miguel A. Cabrera Minagorri --- stable/redis/Chart.yaml | 2 +- stable/redis/templates/redis-master-statefulset.yaml | 4 ++++ stable/redis/templates/redis-slave-statefulset.yaml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stable/redis/Chart.yaml b/stable/redis/Chart.yaml index 1efd6d4c2896..234311ba2fba 100644 --- a/stable/redis/Chart.yaml +++ b/stable/redis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redis -version: 8.0.17 +version: 8.0.18 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/stable/redis/templates/redis-master-statefulset.yaml b/stable/redis/templates/redis-master-statefulset.yaml index 18f2bbce904a..688b313c5b3d 100644 --- a/stable/redis/templates/redis-master-statefulset.yaml +++ b/stable/redis/templates/redis-master-statefulset.yaml @@ -68,6 +68,10 @@ spec: - /bin/bash - -c - | + {{- if (eq .Values.securityContext.runAsUser 0.0) }} + useradd redis + chown -R redis /data + {{- end }} if [[ -n $REDIS_PASSWORD_FILE ]]; then password_aux=`cat ${REDIS_PASSWORD_FILE}` export REDIS_PASSWORD=$password_aux diff --git a/stable/redis/templates/redis-slave-statefulset.yaml b/stable/redis/templates/redis-slave-statefulset.yaml index da6b9228ed4e..dfda0dc808dc 100644 --- a/stable/redis/templates/redis-slave-statefulset.yaml +++ b/stable/redis/templates/redis-slave-statefulset.yaml @@ -76,6 +76,10 @@ spec: - /bin/bash - -c - | + {{- if (eq .Values.securityContext.runAsUser 0.0) }} + useradd redis + chown -R redis /data + {{- end }} if [[ -n $REDIS_PASSWORD_FILE ]]; then password_aux=`cat ${REDIS_PASSWORD_FILE}` export REDIS_PASSWORD=$password_aux