From a7693ee67c54e39f86ffe7466315713b4580f237 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Thu, 14 Sep 2023 17:01:21 +0530 Subject: [PATCH] add configure w Signed-off-by: Shubham Gupta --- entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index dd957d6..265c4e8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -106,9 +106,15 @@ external_config() { start_redis() { if [[ "${SETUP_MODE}" == "cluster" ]]; then echo "Starting redis service in cluster mode....." + if [[ "${NODEPORT}" == "true" ]]; then + CLUSTER_ANNOUNCE_IP="node-ip-$(hostname)" + else + CLUSTER_ANNOUNCE_IP="${POD_IP}" + fi + if [[ "${REDIS_MAJOR_VERSION}" != "v7" ]]; then redis-server /etc/redis/redis.conf \ - --cluster-announce-ip "${POD_IP}" \ + --cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" \ --cluster-announce-hostname "${POD_HOSTNAME}" else redis-server /etc/redis/redis.conf