fix waiting for the cluster once again

This commit is contained in:
phaer 2022-02-11 23:57:18 +01:00
parent 347ba42866
commit 1daa14defc

View File

@ -83,12 +83,17 @@ resource "hcloud_server" "first_control_plane" {
# wait for k3s to get ready # wait for k3s to get ready
<<-EOT <<-EOT
timeout 120 bash <<EOF timeout 120 bash <<EOF
until [ -e /etc/rancher/k3s/k3s.yaml ]; do until systemctl status k3s-server > /dev/null; do
echo "Waiting for kubectl config" systemctl start k3s-server
echo "Initiating the cluster..."
sleep 1 sleep 1
done done
until [[ "$(kubectl get --raw='/readyz')" == "ok" ]]; do until [ -e /etc/rancher/k3s/k3s.yaml ]; do
echo "Waiting for cluster to become ready" echo "Waiting for kubectl config..."
sleep 1
done
until [[ "\$(kubectl get --raw='/readyz')" == "ok" ]]; do
echo "Waiting for cluster to become ready..."
sleep 1 sleep 1
done done
EOF EOF