making k3s start more robust

This commit is contained in:
Karim Naufal
2022-02-20 02:04:37 +01:00
parent c49a65308b
commit e39dc064e2
4 changed files with 7 additions and 3 deletions

View File

@@ -72,12 +72,14 @@ resource "hcloud_server" "agents" {
inline = local.install_k3s_agent
}
# Upon reboot verify that k3s agent starts correctly
# Start the k3s agent and wait for it to have started
provisioner "remote-exec" {
inline = [
"systemctl start k3s-agent",
<<-EOT
timeout 120 bash <<EOF
until systemctl status k3s-agent > /dev/null; do
systemctl start k3s-agent
echo "Waiting for the k3s agent to start..."
sleep 2
done