From bbacfbdacee322c2a2ef125a2b006c2dbe54bf88 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 10 Jul 2019 13:56:24 +0530 Subject: [PATCH] [stable/redis] allow user to supply additional configurations for master/slave and sentinel nodes (#15343) ref #14515 Signed-off-by: Sameer Naik --- stable/redis/Chart.yaml | 2 +- stable/redis/README.md | 5 ++++- stable/redis/templates/configmap.yaml | 26 +++++++++++++++++++------- stable/redis/values-production.yaml | 12 ++++++++++++ stable/redis/values.yaml | 12 ++++++++++++ 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/stable/redis/Chart.yaml b/stable/redis/Chart.yaml index 23449ee9da..a8400fcdb2 100644 --- a/stable/redis/Chart.yaml +++ b/stable/redis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redis -version: 8.0.19 +version: 8.1.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/stable/redis/README.md b/stable/redis/README.md index ded848ca09..122c9d0442 100644 --- a/stable/redis/README.md +++ b/stable/redis/README.md @@ -136,7 +136,7 @@ The following table lists the configurable parameters of the Redis chart and the | `usePassword` | Use password | `true` | | `usePasswordFile` | Mount passwords as files instead of environment variables | `false` | | `password` | Redis password (ignored if existingSecret set) | Randomly generated | -| `configmap` | Redis configuration file to be used | See values.yaml | +| `configmap` | Additional common Redis node configuration | See values.yaml | | `clusterDomain` | Kubernetes DNS Domain name to use | `cluster.local` | | `networkPolicy.enabled` | Enable NetworkPolicy | `false` | | `networkPolicy.allowExternal` | Don't require client label for connections | `true` | @@ -178,6 +178,7 @@ The following table lists the configurable parameters of the Redis chart and the | `master.podAnnotations` | Additional annotations for Redis master pod | {} | | `redisPort` | Redis port (in both master and slaves) | `6379` | | `master.command` | Redis master entrypoint string. The command `redis-server` is executed if this is not provided. | `/run.sh` | +| `master.configmap` | Additional Redis configuration for the master nodes | `nil` | | `master.disableCommands` | Array of Redis commands to disable (master) | `["FLUSHDB", "FLUSHALL"]` | | `master.extraFlags` | Redis master additional command line flags | [] | | `master.nodeSelector` | Redis master Node labels for pod assignment | {"beta.kubernetes.io/arch": "amd64"} | @@ -215,6 +216,7 @@ 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.command` | Redis slave entrypoint array. The docker image's ENTRYPOINT is used if this is not provided. | `/run.sh` | +| `slave.configmap` | Additional Redis configuration for the slave nodes | `nil` | | `slave.disableCommands` | Array of Redis commands to disable (slave) | `[FLUSHDB, FLUSHALL]` | | `slave.extraFlags` | Redis slave additional command line flags | `[]` | | `slave.livenessProbe.enabled` | Turn on and off liveness probe (redis slave pod) | `true` | @@ -251,6 +253,7 @@ The following table lists the configurable parameters of the Redis chart and the | `sentinel.failoverTimeout` | Timeout for performing a election failover | `18000` | | `sentinel.parallelSyncs` | Number of parallel syncs in the cluster | `1` | | `sentinel.port` | Redis Sentinel port | `26379` | +| `sentinel.configmap` | Additional Redis configuration for the sentinel nodes | `nil` | | `sentinel.service.type` | Kubernetes Service type (redis sentinel) | `ClusterIP` | | `sentinel.service.nodePort` | Kubernetes Service nodePort (redis sentinel) | `nil` | | `sentinel.service.annotations` | annotations for redis sentinel service | {} | diff --git a/stable/redis/templates/configmap.yaml b/stable/redis/templates/configmap.yaml index a82e2c78d7..e6005e77fa 100644 --- a/stable/redis/templates/configmap.yaml +++ b/stable/redis/templates/configmap.yaml @@ -15,6 +15,10 @@ data: {{- end }} master.conf: |- dir {{ .Values.master.persistence.path }} +{{- if .Values.master.configmap }} + # User-supplied master configuration: +{{ .Values.master.configmap | indent 4 }} +{{- end }} {{- if .Values.master.disableCommands }} {{- range .Values.master.disableCommands }} rename-command {{ . }} "" @@ -23,6 +27,10 @@ data: replica.conf: |- dir {{ .Values.slave.persistence.path }} slave-read-only yes +{{- if .Values.slave.configmap }} + # User-supplied slave configuration: +{{ .Values.slave.configmap | indent 4 }} +{{- end }} {{- if .Values.slave.disableCommands }} {{- range .Values.slave.disableCommands }} rename-command {{ . }} "" @@ -30,11 +38,15 @@ data: {{- end }} {{- if .Values.sentinel.enabled }} sentinel.conf: |- - dir "/tmp" - bind 0.0.0.0 - port {{ .Values.sentinel.port }} - sentinel monitor {{ .Values.sentinel.masterSet }} {{ template "redis.fullname" . }}-master-0.{{ template "redis.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ .Values.redisPort }} {{ .Values.sentinel.quorum }} - sentinel down-after-milliseconds {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.downAfterMilliseconds }} - sentinel failover-timeout {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.failoverTimeout }} - sentinel parallel-syncs {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.parallelSyncs }} + dir "/tmp" + bind 0.0.0.0 + port {{ .Values.sentinel.port }} + sentinel monitor {{ .Values.sentinel.masterSet }} {{ template "redis.fullname" . }}-master-0.{{ template "redis.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ .Values.redisPort }} {{ .Values.sentinel.quorum }} + sentinel down-after-milliseconds {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.downAfterMilliseconds }} + sentinel failover-timeout {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.failoverTimeout }} + sentinel parallel-syncs {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.parallelSyncs }} +{{- if .Values.sentinel.configmap }} + # User-supplied sentinel configuration: +{{ .Values.sentinel.configmap | indent 4 }} +{{- end }} {{- end }} diff --git a/stable/redis/values-production.yaml b/stable/redis/values-production.yaml index 08eaa636ee..0caba7801e 100644 --- a/stable/redis/values-production.yaml +++ b/stable/redis/values-production.yaml @@ -66,6 +66,10 @@ sentinel: failoverTimeout: 18000 parallelSyncs: 1 port: 26379 + ## Additional Redis configuration for the sentinel nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Configure extra options for Redis Sentinel liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## @@ -189,6 +193,10 @@ master: ## Can be used to specify command line arguments, for example: ## command: "/run.sh" + ## Additional Redis configuration for the master nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Redis additional command line flags ## ## Can be used to specify command line flags, for example: @@ -332,6 +340,10 @@ slave: ## Can be used to specify command line arguments, for example: ## command: "/run.sh" + ## Additional Redis configuration for the slave nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Redis extra flags extraFlags: [] ## List of Redis commands to disable diff --git a/stable/redis/values.yaml b/stable/redis/values.yaml index 8aa96944e7..80b15ab7df 100644 --- a/stable/redis/values.yaml +++ b/stable/redis/values.yaml @@ -66,6 +66,10 @@ sentinel: failoverTimeout: 18000 parallelSyncs: 1 port: 26379 + ## Additional Redis configuration for the sentinel nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Configure extra options for Redis Sentinel liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## @@ -189,6 +193,10 @@ master: ## Can be used to specify command line arguments, for example: ## command: "/run.sh" + ## Additional Redis configuration for the master nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Redis additional command line flags ## ## Can be used to specify command line flags, for example: @@ -332,6 +340,10 @@ slave: ## Can be used to specify command line arguments, for example: ## command: "/run.sh" + ## Additional Redis configuration for the slave nodes + ## ref: https://redis.io/topics/config + ## + configmap: ## Redis extra flags extraFlags: [] ## List of Redis commands to disable