mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Wait until master IP is visible
This commit is contained in:
parent
eed1e02346
commit
f7d0615e2b
@ -411,7 +411,21 @@ function create-static-ip() {
|
|||||||
if gcloud compute addresses create "$1" \
|
if gcloud compute addresses create "$1" \
|
||||||
--project "${PROJECT}" \
|
--project "${PROJECT}" \
|
||||||
--region "${REGION}" -q > /dev/null; then
|
--region "${REGION}" -q > /dev/null; then
|
||||||
# successful operation
|
# successful operation - wait until it's visible
|
||||||
|
start="$(date +%s)"
|
||||||
|
while true; do
|
||||||
|
now="$(date +%s)"
|
||||||
|
# Timeout set to 15 minutes
|
||||||
|
if [ $((now - start)) -gt 900 ]; then
|
||||||
|
echo "Timeout while waiting for master IP visibility"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if gcloud compute addresses describe "$1" --project "${PROJECT}" --region "${REGION}" >/dev/null 2>&1; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Master IP not visible yet. Waiting..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user