docker-keepalived-k8s/check_apiserver.sh

14 lines
396 B
Bash
Raw Normal View History

#!/bin/sh
2022-01-03 16:21:52 +00:00
vip="$1"
port="$2"
errorExit() {
echo "*** $*" 1>&2
exit 1
}
2022-01-03 16:21:52 +00:00
curl --silent --max-time 2 --insecure https://localhost:"$port"/healthz -o /dev/null || errorExit "Error GET https://localhost:$port/healthz"
if ip addr | grep -q "$vip"; then
curl --silent --max-time 2 --insecure "https://$vip:$port/healthz" -o /dev/null || errorExit "Error GET https://$vip:$port/healthz"
fi