Skip to content

Commit

Permalink
Support cluster announce params when redis cluster use nodeport (#66)
Browse files Browse the repository at this point in the history
* Support cluster announce params when redis cluster use nodeport

Signed-off-by: drivebyer <[email protected]>

* fix node ip env

Signed-off-by: drivebyer <[email protected]>

---------

Signed-off-by: drivebyer <[email protected]>
  • Loading branch information
drivebyer authored Dec 25, 2023
1 parent 48a503f commit 24c4acc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ port_setup() {
{
echo port "${REDIS_PORT}"
} >> /etc/redis/redis.conf

if [[ "${NODEPORT}" == "true" ]]; then
{
echo cluster-announce-port "${CLUSTER_ANNOUNCE_PORT}"
echo cluster-announce-bus-port "${CLUSTER_ANNOUNCE_BUS_PORT}"
} >> /etc/redis/redis.conf
fi
}

external_config() {
Expand All @@ -113,7 +120,7 @@ start_redis() {
if [[ "${SETUP_MODE}" == "cluster" ]]; then
echo "Starting redis service in cluster mode....."
if [[ "${NODEPORT}" == "true" ]]; then
CLUSTER_ANNOUNCE_IP_VAR="node_ip_$(hostname | tr '-' '_')"
CLUSTER_ANNOUNCE_IP_VAR="HOST_IP"
CLUSTER_ANNOUNCE_IP="${!CLUSTER_ANNOUNCE_IP_VAR}"
else
CLUSTER_ANNOUNCE_IP="${POD_IP}"
Expand Down

0 comments on commit 24c4acc

Please sign in to comment.