mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-12-31 21:56:41 +01:00
24 lines
629 B
Bash
24 lines
629 B
Bash
#!/usr/bin/env sh
|
|
|
|
S_ADDR="192.168.56.110"
|
|
|
|
echo "Launching k3s install"
|
|
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" sh -s - server --cluster-init --node-ip=$S_ADDR --bind-address=$S_ADDR --advertise-address=$S_ADDR
|
|
|
|
# Additional wait to ensure API is responsive (optional but helpful)
|
|
I=0
|
|
until k3s kubectl get --raw='/readyz' > /dev/null 2>&1; do
|
|
echo "Waiting for K3s to be ready..."
|
|
sleep 5
|
|
I=$((I+1))
|
|
if [ $I -eq 5 ]; then
|
|
echo "threshold gone, ffs"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo "K3s is ready!"
|
|
|
|
echo "Copying token"
|
|
cat /var/lib/rancher/k3s/server/node-token > /vagrant/node-token
|