From f712bbfba7e75ff40b78edf8e37116cacceb6d96 Mon Sep 17 00:00:00 2001 From: Timothy Clarke Date: Fri, 25 Sep 2020 14:28:55 +0100 Subject: [PATCH] Restore Redis Master and Slave 'command' functionality, with new variables (#3773) * Restore Redis Master and Slave 'command' functionality, with new variables * Updated values-production.yaml --- bitnami/redis/Chart.yaml | 2 +- bitnami/redis/README.md | 6 ++++-- bitnami/redis/templates/configmap-scripts.yaml | 6 ++++++ bitnami/redis/values-production.yaml | 8 ++++++++ bitnami/redis/values.yaml | 10 +++++++++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/bitnami/redis/Chart.yaml b/bitnami/redis/Chart.yaml index 7d11ca38c..5faab0e78 100644 --- a/bitnami/redis/Chart.yaml +++ b/bitnami/redis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redis -version: 11.0.4 +version: 11.0.5 appVersion: 6.0.8 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/bitnami/redis/README.md b/bitnami/redis/README.md index ba99f2c5d..58fe23944 100644 --- a/bitnami/redis/README.md +++ b/bitnami/redis/README.md @@ -150,7 +150,8 @@ The following table lists the configurable parameters of the Redis chart and the | `tls.certKeyFilename` | Certificate key filename | `nil` | | `tls.certCAFilename` | CA Certificate filename |`nil` | | `tls.dhParamsFilename` | DH params (in order to support DH based ciphers) |`nil` | -| `master.command` | Redis master entrypoint string. The command `redis-server` is executed if this is not provided. | `/run.sh` | +| `master.command` | Redis master entrypoint string. The command `redis-server` is executed if this is not provided. Note this is prepended with `exec` | `/run.sh` | +| `master.preExecCmds` | Text to inset into the startup script immediately prior to `master.command`. Use this if you need to run other ad-hoc commands as part of startup | `nil` | | `master.configmap` | Additional Redis configuration for the master nodes (this value is evaluated as a template) | `nil` | | `master.disableCommands` | Array of Redis commands to disable (master) | `["FLUSHDB", "FLUSHALL"]` | | `master.extraFlags` | Redis master additional command line flags | [] | @@ -193,7 +194,8 @@ The following table lists the configurable parameters of the Redis chart and the | `slave.service.port` | Kubernetes Service port (redis slave) | `6379` | | `slave.service.loadBalancerIP` | LoadBalancerIP if Redis slave service type is `LoadBalancer` | `nil` | | `slave.service.loadBalancerSourceRanges` | loadBalancerSourceRanges if Redis slave service type is `LoadBalancer` | `nil` | -| `slave.command` | Redis slave entrypoint array. The docker image's ENTRYPOINT is used if this is not provided. | `/run.sh` | +| `slave.command` | Redis slave entrypoint string. The command `redis-server` is executed if this is not provided. Note this is prepended with `exec` | `/run.sh` | +| `slave.preExecCmds` | Text to inset into the startup script immediately prior to `slave.command`. Use this if you need to run other ad-hoc commands as part of startup | `nil` | | `slave.configmap` | Additional Redis configuration for the slave nodes (this value is evaluated as a template) | `nil` | | `slave.disableCommands` | Array of Redis commands to disable (slave) | `[FLUSHDB, FLUSHALL]` | | `slave.extraFlags` | Redis slave additional command line flags | `[]` | diff --git a/bitnami/redis/templates/configmap-scripts.yaml b/bitnami/redis/templates/configmap-scripts.yaml index 4795c3d58..d78fe3d7e 100644 --- a/bitnami/redis/templates/configmap-scripts.yaml +++ b/bitnami/redis/templates/configmap-scripts.yaml @@ -279,6 +279,9 @@ data: ARGS+=({{ . | quote }}) {{- end }} {{- end }} + {{- if .Values.master.preExecCmds }} + {{ .Values.master.preExecCmds | nindent 4}} + {{- end }} {{- if .Values.master.command }} exec {{ .Values.master.command }} "${ARGS[@]}" {{- else }} @@ -333,6 +336,9 @@ data: ARGS+=({{ . | quote }}) {{- end }} {{- end }} + {{- if .Values.slave.preExecCmds }} + {{ .Values.slave.preExecCmds | nindent 4}} + {{- end }} {{- if .Values.slave.command }} exec {{ .Values.slave.command }} "${ARGS[@]}" {{- else }} diff --git a/bitnami/redis/values-production.yaml b/bitnami/redis/values-production.yaml index 08908921b..e6bf6b456 100644 --- a/bitnami/redis/values-production.yaml +++ b/bitnami/redis/values-production.yaml @@ -252,8 +252,12 @@ master: ## Redis command arguments ## ## Can be used to specify command line arguments, for example: + ## Note `exec` is prepended to command ## command: "/run.sh" + ## Additional commands to run prior to starting Redis + ## + preExecCmds: "" ## Additional Redis configuration for the master nodes ## ref: https://redis.io/topics/config ## @@ -456,8 +460,12 @@ slave: ## Redis slave port port: 6379 ## Can be used to specify command line arguments, for example: + ## Note `exec` is prepended to command ## command: "/run.sh" + ## Additional commands to run prior to starting Redis + ## + preExecCmds: "" ## Additional Redis configuration for the slave nodes ## ref: https://redis.io/topics/config ## diff --git a/bitnami/redis/values.yaml b/bitnami/redis/values.yaml index af1610203..e442d9305 100644 --- a/bitnami/redis/values.yaml +++ b/bitnami/redis/values.yaml @@ -150,7 +150,7 @@ networkPolicy: ## # allowExternal: true - ## Allow connections from other namespacess. Just set label for namespace and set label for pods (optional). + ## Allow connections from other namespaces. Just set label for namespace and set label for pods (optional). ## ingressNSMatchLabels: {} ingressNSPodMatchLabels: {} @@ -252,8 +252,12 @@ master: ## Redis command arguments ## ## Can be used to specify command line arguments, for example: + ## Note `exec` is prepended to command ## command: "/run.sh" + ## Additional commands to run prior to starting Redis + ## + preExecCmds: "" ## Additional Redis configuration for the master nodes ## ref: https://redis.io/topics/config ## @@ -456,8 +460,12 @@ slave: ## Redis slave port port: 6379 ## Can be used to specify command line arguments, for example: + ## Note `exec` is prepended to command ## command: "/run.sh" + ## Additional commands to run prior to starting Redis + ## + preExecCmds: "" ## Additional Redis configuration for the slave nodes ## ref: https://redis.io/topics/config ##