Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 97f205f

Browse files
authored
redis fix (#4331)
1 parent 331a5d5 commit 97f205f

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

base/redis/redis-cache.Deployment.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,22 @@ spec:
3737
name: redis
3838
readinessProbe:
3939
initialDelaySeconds: 5
40-
tcpSocket:
41-
port: redis
40+
exec:
41+
command:
42+
- /bin/sh
43+
- -c
44+
- |
45+
#!/bin/bash
46+
if [ -f /etc/redis/redis.conf ]; then
47+
export REDISCLI_AUTH=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
48+
fi
49+
response=$(
50+
redis-cli ping
51+
)
52+
if [ "$response" != "PONG" ]; then
53+
echo "$response"
54+
exit 1
55+
fi
4256
resources:
4357
limits:
4458
cpu: "1"

base/redis/redis-store.Deployment.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,22 @@ spec:
3636
name: redis
3737
readinessProbe:
3838
initialDelaySeconds: 5
39-
tcpSocket:
40-
port: redis
39+
exec:
40+
command:
41+
- /bin/sh
42+
- -c
43+
- |
44+
#!/bin/bash
45+
if [ -f /etc/redis/redis.conf ]; then
46+
export REDISCLI_AUTH=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
47+
fi
48+
response=$(
49+
redis-cli ping
50+
)
51+
if [ "$response" != "PONG" ]; then
52+
echo "$response"
53+
exit 1
54+
fi
4155
resources:
4256
limits:
4357
cpu: "1"

0 commit comments

Comments
 (0)