Skip to content

Commit 8494b91

Browse files
committed
feat: add support for multiple unicast peers in keepalived configuration
1 parent c0d045a commit 8494b91

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PRIORITY=100
1111
ROUTER_ID=52
1212
VIRTUAL_IPS=192.168.1.100/24
1313
UNICAST_SRC_IP=192.168.1.101
14-
UNICAST_PEERS=192.168.1.102
14+
UNICAST_PEERS="192.168.1.102,192.168.1.103,192.168.1.104"
1515
WEIGHT=50
1616
FALL=2
1717
RISE=2

docker-entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ if [ -n "$TZ" ]; then
77
echo "$TZ" > /etc/timezone
88
fi
99

10+
# Format the UNICAST_PEERS for proper indentation
11+
export UNICAST_PEERS=$(echo "$UNICAST_PEERS" | tr ',' '\n' | sed 's/^[[:space:]]*//g' | sed 's/[[:space:]]*$//g' | sed 's/^/ /')
12+
1013
# Generate keepalived configuration from template
1114
envsubst < /conf/keepalived.conf_tpl > /etc/keepalived/keepalived.conf
1215

0 commit comments

Comments
 (0)