From aca6fbe7de0f8100dea088bfd515e0f3195ea5ec Mon Sep 17 00:00:00 2001 From: Chris Boot Date: Thu, 16 May 2024 23:26:44 +0100 Subject: [PATCH] redis-ha: add custom command and args for sentinel container Signed-off-by: Chris Boot --- charts/redis-ha/Chart.yaml | 2 +- charts/redis-ha/README.md | 2 ++ charts/redis-ha/templates/redis-ha-statefulset.yaml | 8 ++++++++ charts/redis-ha/values.yaml | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/redis-ha/Chart.yaml b/charts/redis-ha/Chart.yaml index 9d356b6..53e1430 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.26.6 +version: 4.26.7 appVersion: 7.2.4 description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png diff --git a/charts/redis-ha/README.md b/charts/redis-ha/README.md index 136bd98..f4c6418 100644 --- a/charts/redis-ha/README.md +++ b/charts/redis-ha/README.md @@ -119,6 +119,8 @@ The following table lists the configurable parameters of the Redis chart and the | `sentinel.password` | A password that configures a `requirepass` in the conf parameters (Requires `sentinel.auth: enabled`) |``| | `sentinel.existingSecret` | An existing secret containing a key defined by `sentinel.authKey` that configures `requirepass` in the conf parameters (Requires `sentinel.auth: enabled`, cannot be used in conjunction with `.Values.sentinel.password`) |``| | `sentinel.authKey` | The key holding the sentinel password in an existing secret. | `sentinel-password` | +| `sentinel.customCommand` | Allows overriding the sentinel container command | `[]` | +| `sentinel.customArgs` | Allows overriding the sentinel container arguments | `[]` | | `sentinel.quorum` | Minimum number of servers necessary to maintain quorum | `2` | | `sentinel.config` | Valid sentinel config options in this section will be applied as config options to each sentinel (see below) | see values.yaml | | `sentinel.customConfig` | Allows for custom sentinel.conf files to be applied. If this is used then `sentinel.config` is ignored |``| diff --git a/charts/redis-ha/templates/redis-ha-statefulset.yaml b/charts/redis-ha/templates/redis-ha-statefulset.yaml index 610358c..c9cf51d 100644 --- a/charts/redis-ha/templates/redis-ha-statefulset.yaml +++ b/charts/redis-ha/templates/redis-ha-statefulset.yaml @@ -333,9 +333,17 @@ spec: image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: + {{- if .Values.sentinel.customCommand }} +{{ toYaml .Values.sentinel.customCommand | indent 10 }} + {{- else }} - redis-sentinel + {{- end }} args: + {{- if .Values.sentinel.customArgs }} +{{ toYaml .Values.sentinel.customArgs | indent 10 }} + {{- else }} - /data/conf/sentinel.conf + {{- end }} securityContext: {{ toYaml .Values.containerSecurityContext | nindent 10 }} {{- if or .Values.auth .Values.sentinel.auth}} env: diff --git a/charts/redis-ha/values.yaml b/charts/redis-ha/values.yaml index a063ba1..342bd7d 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -379,6 +379,9 @@ sentinel: ## Defines the key holding the sentinel password in existing secret. authKey: sentinel-password + customCommand: [] + customArgs: [] + # liveness probe parameters for sentinel container livenessProbe: initialDelaySeconds: 30