From 37363dc77528fc169d7a739853e5b9ce3abba12c Mon Sep 17 00:00:00 2001 From: Chris Boot Date: Tue, 16 Jul 2024 10:15:07 +0100 Subject: [PATCH] redis-ha: add custom command and args for sentinel container (#277) 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 f981eb4..3194544 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.27.0 +version: 4.27.1 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 c4dbddc..3f689e9 100644 --- a/charts/redis-ha/README.md +++ b/charts/redis-ha/README.md @@ -120,6 +120,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 09c75f1..9ca6544 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 06908ad..2edbf6a 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -384,6 +384,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