」 feat: fixed the p1 so it launch in one command, no more --no-provision

This commit is contained in:
2025-12-16 21:36:24 +01:00
parent c736c9f155
commit ab440e31c0
6 changed files with 63 additions and 23 deletions

View File

@ -1,8 +1,32 @@
#!/usr/bin/env sh
while [ ! -f /vagrant/node-token ];
do sleep 2;
done
S_ADDR="192.168.56.110"
SW_ADDR="192.168.56.111"
TOKEN=$(cat /vagrant/node-token)
curl -sfL https://get.k3s.io | K3S_URL=https://192.168.56.110:6443 K3S_TOKEN=$TOKEN sh -s - --node-ip=192.168.56.111
# In setup-SW.sh, before the k3s install command
# echo "Checking connectivity to server"
# I=0
# while ! curl -k https://$S_ADDR:6443/healthz > /dev/null 2>&1; do
# echo "Server API not reachable yet, waiting..."
# sleep 5
# I=$((I+1))
# if [ $I -eq 5 ]; then
# exit 1
# fi
# done
echo "Server is reachable, proceeding with k3s agent install"
echo "Waiting for token"
I=0
while [ ! -f /vagrant/node-token ]; do
sleep 2;
I=$((I+1))
if [ $I -eq 20 ]; then
echo "threshold gone, ffs"
exit 1
fi
done
echo "Token found"
echo "Launching k3s install"
curl -sfL https://get.k3s.io | K3S_URL=https://$S_ADDR:6443 sh -s - agent --node-ip=$SW_ADDR --token-file /vagrant/node-token --server https://$S_ADDR:6443