[stable/redis] Allow templates in user-provided configmap values (#16363)

* Allow templates in user-provided configmap values

Render configmap, master.configmap, slave.configmap, and
sentinel.configmap using the tpl function.

This allows us to do things like set the dbfilename to the release name
And is useful for charts that use redis as a subchart and want to
provide additional redis settings for users to tune.

Signed-off-by: DJ Mountney <david@twkie.net>

* Update readme to reference values now parsed as templates

Signed-off-by: DJ Mountney <david@twkie.net>
This commit is contained in:
DJ Mountney
2019-08-19 03:19:29 -07:00
committed by Kubernetes Prow Robot
parent f61060dfb3
commit e13bb2a7e9
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: redis
version: 9.0.2
version: 9.0.3
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:
+4 -4
View File
@@ -138,7 +138,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` | Additional common Redis node configuration | See values.yaml |
| `configmap` | Additional common Redis node configuration (this value is evaluated as a template) | 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` |
@@ -180,7 +180,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.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 | [] |
| `master.nodeSelector` | Redis master Node labels for pod assignment | {"beta.kubernetes.io/arch": "amd64"} |
@@ -218,7 +218,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.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 | `[]` |
| `slave.livenessProbe.enabled` | Turn on and off liveness probe (redis slave pod) | `true` |
@@ -255,7 +255,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.configmap` | Additional Redis configuration for the sentinel nodes (this value is evaluated as a template) | `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 | {} |
+4 -4
View File
@@ -11,13 +11,13 @@ data:
redis.conf: |-
{{- if .Values.configmap }}
# User-supplied configuration:
{{ .Values.configmap | indent 4 }}
{{ tpl .Values.configmap . | indent 4 }}
{{- end }}
master.conf: |-
dir {{ .Values.master.persistence.path }}
{{- if .Values.master.configmap }}
# User-supplied master configuration:
{{ .Values.master.configmap | indent 4 }}
{{ tpl .Values.master.configmap . | indent 4 }}
{{- end }}
{{- if .Values.master.disableCommands }}
{{- range .Values.master.disableCommands }}
@@ -29,7 +29,7 @@ data:
slave-read-only yes
{{- if .Values.slave.configmap }}
# User-supplied slave configuration:
{{ .Values.slave.configmap | indent 4 }}
{{ tpl .Values.slave.configmap . | indent 4 }}
{{- end }}
{{- if .Values.slave.disableCommands }}
{{- range .Values.slave.disableCommands }}
@@ -47,6 +47,6 @@ data:
sentinel parallel-syncs {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.parallelSyncs }}
{{- if .Values.sentinel.configmap }}
# User-supplied sentinel configuration:
{{ .Values.sentinel.configmap | indent 4 }}
{{ tpl .Values.sentinel.configmap . | indent 4 }}
{{- end }}
{{- end }}