Skip to content

Commit 00b9882

Browse files
[redis] return fqdn for sentinel master lookup (CloudPirates-io#156)
* [redis] use fqdn for sentinel redis master, to avoid problems when calling it in other namespaces * Update CHANGELOG.md Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update CHANGELOG.md Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 9f3ceea commit 00b9882

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

charts/mongodb/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changelog
22

3-
## 0.2.0 (2025-09-24)
3+
## 0.2.0 (2025-09-25)
44

5-
* [mongodb] add custom user creation at initialization ([#153](https://github.com/CloudPirates-io/helm-charts/pull/153))
5+
* [redis] return fqdn for sentinel master lookup ([#156](https://github.com/CloudPirates-io/helm-charts/pull/156))

charts/redis/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changelog
22

3-
## 0.4.5 (2025-09-24)
3+
## 0.4.6 (2025-09-25)
44

5-
* [redis] fix requirepass for sentinels when password is set ([#152](https://github.com/CloudPirates-io/helm-charts/pull/152))
5+
* [redis] return fqdn for sentinel master lookup ([#156](https://github.com/CloudPirates-io/helm-charts/pull/156))

charts/redis/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: redis
33
description: An open source, in-memory data structure store used as a database, cache, and message broker.
44
type: application
5-
version: 0.4.5
5+
version: 0.4.6
66
appVersion: "8.2.1"
77
keywords:
88
- redis

charts/redis/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ spec:
296296
if [ "$SENTINEL_FOUND_MASTER" = false ]; then
297297
echo "No Sentinels available, checking Redis instances directly..."
298298
for i in $(seq 0 $(({{ if eq .Values.architecture "standalone" }}1{{ else }}{{ .Values.replicaCount }}{{ end }} - 1))); do
299-
REDIS_HOST="{{ include "redis.fullname" . }}-${i}.{{ include "redis.fullname" . }}-headless"
299+
REDIS_HOST="{{ include "redis.fullname" . }}-${i}.{{ include "redis.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local"
300300
ROLE_INFO=$(redis-cli -h "${REDIS_HOST}" -p {{ .Values.service.port }} {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} info replication 2>/dev/null | grep "role:master" || echo "")
301301
if [ -n "$ROLE_INFO" ]; then
302302
MASTER_HOST="$REDIS_HOST"
@@ -308,7 +308,7 @@ spec:
308308
309309
# Final fallback: Use pod-0 hostname for initial bootstrap only
310310
if [ -z "$MASTER_HOST" ]; then
311-
MASTER_HOST="{{ include "redis.fullname" . }}-0.{{ include "redis.fullname" . }}-headless"
311+
MASTER_HOST="{{ include "redis.fullname" . }}-0.{{ include "redis.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local"
312312
echo "No existing master found, using pod-0 for initial bootstrap: $MASTER_HOST"
313313
fi
314314

0 commit comments

Comments
 (0)