From 8ea9663cd40bdd08067c4b3a88ef0f3747a5df62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20de=20Paz=20Gal=C3=A1n?= Date: Wed, 23 Sep 2020 10:45:30 +0200 Subject: [PATCH] [bitnami/redis] Allow use without cluster/sentinel (#3738) * [bitnami/redis] Allow use without cluster/sentinel Signed-off-by: FraPazGal * Add warning and deployment of standalone redis when using wrong value combination --- bitnami/redis/templates/NOTES.txt | 14 ++++++++++++++ bitnami/redis/templates/configmap-scripts.yaml | 3 ++- .../redis/templates/redis-master-statefulset.yaml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bitnami/redis/templates/NOTES.txt b/bitnami/redis/templates/NOTES.txt index bda50622c..6e990ab41 100644 --- a/bitnami/redis/templates/NOTES.txt +++ b/bitnami/redis/templates/NOTES.txt @@ -20,6 +20,20 @@ {{- end }} {{- end }} +{{- if and .Values.sentinel.enabled (not .Values.cluster.enabled)}} + +------------------------------------------------------------------------------- + WARNING + + Using redis sentinel without a cluster is not supported. A single pod with + standalone redis has been deployed. + + To deploy redis sentinel, please use the values "cluster.enabled=true" and + "sentinel.enabled=true". + +------------------------------------------------------------------------------- +{{- end }} + {{- if .Values.cluster.enabled }} {{- if .Values.sentinel.enabled }} Redis can be accessed via port {{ .Values.sentinel.service.redisPort }} on the following DNS name from within your cluster: diff --git a/bitnami/redis/templates/configmap-scripts.yaml b/bitnami/redis/templates/configmap-scripts.yaml index 87ae32c77..4795c3d58 100644 --- a/bitnami/redis/templates/configmap-scripts.yaml +++ b/bitnami/redis/templates/configmap-scripts.yaml @@ -284,7 +284,7 @@ data: {{- else }} exec redis-server "${ARGS[@]}" {{- end }} - + {{- if .Values.cluster.enabled }} start-slave.sh: | #!/bin/bash {{- if (eq (.Values.securityContext.runAsUser | int) 0) }} @@ -338,5 +338,6 @@ data: {{- else }} exec redis-server "${ARGS[@]}" {{- end }} + {{- end }} {{- end -}} diff --git a/bitnami/redis/templates/redis-master-statefulset.yaml b/bitnami/redis/templates/redis-master-statefulset.yaml index 1d55f930a..36dc4f57b 100644 --- a/bitnami/redis/templates/redis-master-statefulset.yaml +++ b/bitnami/redis/templates/redis-master-statefulset.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.cluster.enabled (not .Values.sentinel.enabled) }} +{{- if or (not .Values.cluster.enabled) (not .Values.sentinel.enabled) }} apiVersion: apps/v1 kind: StatefulSet metadata: