You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while ! redis-cli {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} -h 127.0.0.1 -p {{ .Values.service.port }} ping >/dev/null 2>&1; do
314
+
{{- if eq .Values.ipFamily "ipv6" }}
315
+
REDIS_HOST="::1"
316
+
{{- else }}
317
+
REDIS_HOST="127.0.0.1"
318
+
{{- end }}
319
+
while ! redis-cli {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} -h "${REDIS_HOST}" -p {{ .Values.service.port }} ping >/dev/null 2>&1; do
292
320
sleep 1
293
321
done
294
322
echo "Redis is ready"
@@ -355,7 +383,7 @@ spec:
355
383
# Create Sentinel config
356
384
cat > /tmp/sentinel.conf << EOF
357
385
port {{ .Values.sentinel.port }}
358
-
bind 0.0.0.0
386
+
bind * -::*
359
387
# Enable hostname resolution for Redis Sentinel
360
388
sentinel resolve-hostnames yes
361
389
sentinel announce-hostnames yes
@@ -407,9 +435,11 @@ spec:
407
435
command:
408
436
- /bin/sh
409
437
- -c
410
-
- |
411
-
# Check if sentinel is responding
412
-
redis-cli -h 127.0.0.1 -p {{ .Values.sentinel.port }} {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} ping | grep -q PONG
438
+
{{- if eq .Values.ipFamily "ipv6" }}
439
+
- redis-cli -h "::1" -p {{ .Values.sentinel.port }} {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} ping | grep -q PONG
440
+
{{- else }}
441
+
- redis-cli -h "127.0.0.1" -p {{ .Values.sentinel.port }} {{- if .Values.auth.enabled }} -a "${REDIS_PASSWORD}"{{- end }} ping | grep -q PONG
0 commit comments