Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion templates/common/on-prem/files/keepalived.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,21 @@ contents:
done
}

remove_vip()
{
address=$1
interface=$(ip -o a | awk "/\s${address}\// {print \$2}")
cidr=$(ip -o a | awk "/\s${address}\// {print \$4}")
if [ -n "$interface" ]; then
ip a del $cidr dev $interface
fi
}

set -ex
# Ensure that we don't have stale VIPs configured
# See https://bugzilla.redhat.com/show_bug.cgi?id=1931505
remove_vip "{{ onPremPlatformAPIServerInternalIP . }}"
remove_vip "{{ onPremPlatformIngressIP . }}"
declare -r keepalived_sock="/var/run/keepalived/keepalived.sock"
export -f msg_handler
export -f reload_keepalived
Expand Down Expand Up @@ -158,4 +172,4 @@ contents:
- operator: Exists
priorityClassName: system-node-critical
status: {}
{{ end -}}
{{ end -}}