#!/bin/bash
set -e

# Install K3s
curl -sfL https://get.k3s.io | sh -

# Wait for k3s to be ready
echo "Waiting for k3s to start..."
until kubectl get nodes &>/dev/null; do
    sleep 2
done

echo "K3s installed successfully"
kubectl get nodes
