blob: 9c86cfad2f0bdc44c40ed122438cd49012f4a035 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
set -e
set -o pipefail
KEEPALIVED_DEBUG=${KEEPALIVED_DEBUG:-false}
KEEPALIVED_KUBE_APISERVER_CHECK=${KEEPALIVED_KUBE_APISERVER_CHECK:-false}
KEEPALIVED_CONF=${KEEPALIVED_CONF:-/etc/keepalived/keepalived.conf}
KEEPALIVED_VAR_RUN=${KEEPALIVED_VAR_RUN:-/var/run/keepalived}
if [[ ${KEEPALIVED_DEBUG,,} == 'true' ]]; then
kd_cmd="/usr/sbin/keepalived -n -l -D -f $KEEPALIVED_CONF"
else
kd_cmd="/usr/sbin/keepalived -n -l -f $KEEPALIVED_CONF"
fi
KEEPALIVED_CMD=${KEEPALIVED_CMD:-"$kd_cmd"}
rm -fr "$KEEPALIVED_VAR_RUN"
exec $KEEPALIVED_CMD
|