From ff1d2fda24258261d8872b57e3ccee7ab590a331 Mon Sep 17 00:00:00 2001 From: karmab Date: Fri, 9 Aug 2024 23:16:11 +0200 Subject: [PATCH] k3s: fix single control plane deployment --- kvirt/cluster/k3s/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvirt/cluster/k3s/bootstrap.sh b/kvirt/cluster/k3s/bootstrap.sh index 3a1f02f79..ef208f28a 100644 --- a/kvirt/cluster/k3s/bootstrap.sh +++ b/kvirt/cluster/k3s/bootstrap.sh @@ -20,7 +20,7 @@ export IP={{ "$(curl -s ifconfig.me)" }} {% elif ctlplanes > 1 %} export IP={{ api_ip }} {% else %} -export IP={{ first_ip }} +export IP=$(hostname -I | cut -f1 -d" ") {% endif %} curl -sfL https://get.k3s.io | {{ install_k3s_args }} K3S_TOKEN={{ token }} sh -s - server {{ '--cluster-init' if ctlplanes > 1 else '' }} {{ extra_args|join(" ") }} {{ '--tls-san $IP' if not cloud_lb and config_type in ['aws', 'gcp', 'ibmcloud'] else '' }}