From ddcc473ea8619f7a6df0f56180f9de32c4d0288d Mon Sep 17 00:00:00 2001 From: phaer Date: Fri, 11 Feb 2022 23:49:16 +0100 Subject: [PATCH] (hopefully) simplify wait for cluster ready --- master.tf | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/master.tf b/master.tf index 417da02..d13b9b2 100644 --- a/master.tf +++ b/master.tf @@ -74,19 +74,24 @@ resource "hcloud_server" "first_control_plane" { "hostnamectl set-hostname ${self.name}", # first we disable automatic reboot (after transactional updates), and configure the reboot method as kured "rebootmgrctl set-strategy off && echo 'REBOOT_METHOD=kured' > /etc/transactional-update.conf", - # then we initiate the cluster - "systemctl enable k3s-server", # prepare a directory for our post-installation kustomizations "mkdir -p /tmp/post_install", - # start k3s and wait for the cluster to be ready + # then we initiate the cluster + "systemctl enable k3s-server", + # start k3s + "systemctl start k3s-server", + # wait for k3s to get ready <<-EOT - until systemctl status k3s-server > /dev/null - do - systemctl start k3s-server - echo "Initiating the cluster..." - sleep 2 + timeout 120 bash <