Skip to content

Commit

Permalink
Update provision-os-step2.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
pastudan authored Mar 17, 2022
1 parent b2190c5 commit c182786
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions provision-os-step2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ mv linux-arm64/helm /usr/local/bin/
chmod +x /usr/local/bin/helm
rm -rf linux-arm64 helm.tar.gz

APISERVER_TIMEOUT=60 # Wait n seconds for k3s apiserver to start
for i in $(seq 1 $APISERVER_TIMEOUT); do
APISERVER_STATUS="$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -k https://localhost:6443)"
echo $APISERVER_STATUS
if [ $APISERVER_STATUS == "401" ]; then
break
fi
sleep 1
done
if [ $APISERVER_STATUS != "401" ]; then
echo "!!! Timeout waiting for k3s apiserver to start !!!"
echo "!!! PROVISION DID NOT COMPLETE !!!"
exit 1
fi

# Stop K3s, remove certs to get regenerated on next boot
k3s kubectl --insecure-skip-tls-verify -n kube-system delete secret k3s-serving
service k3s stop
Expand Down

0 comments on commit c182786

Please sign in to comment.