Cleanup bugfixes. Move vars to dedicated files

This commit is contained in:
Guillaume
2023-06-14 20:21:23 +02:00
parent d46b475e1b
commit 6721e05387
6 changed files with 63 additions and 31 deletions

View File

@ -47,6 +47,24 @@ EOF
done
}
wait_for_apiserver() {
vip=$(extract_var clusters public_vip)
vip_api_port=$(extract_var clusters api_port)
sleep 20
while :
do
pinfo "Waiting for apiserver availability ($vip:$vip_api_port). Images may still being pulled... "
if kctl get node &>/dev/null ; then
pinfo "API is up!"
break
else
sleep 30
fi
done
}
install_addons() {
body='{"Kind":"cluster","Name":"'$cluster'","Assets":["addons"]}'
download_id=$(dls /authorize-download -d "$body"|tr -d \")
@ -82,6 +100,7 @@ unlock_store
declare -A hosts && get_hosts
checkup
start_control_plane
wait_for_apiserver
create_kubeconfig
install_addons
approve_kubelet_certificates # clients and serving certs