mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-03-30 14:25:37 +00:00
✨ feat: topology, and improves handling
This commit is contained in:
@@ -25,20 +25,35 @@ mkdir -p /home/dev/.kube
|
||||
until [ -f /etc/rancher/k3s/k3s.yaml ]; do sleep 1; done
|
||||
sudo cp /etc/rancher/k3s/k3s.yaml /home/dev/.kube/config
|
||||
sudo chown dev:dev /home/dev/.kube/config
|
||||
chmod 600 /home/dev/.kube/config
|
||||
|
||||
# Wait for node
|
||||
echo "==> Waiting for node..."
|
||||
# Allow k3s self-signed certs
|
||||
kubectl config set-cluster default --insecure-skip-tls-verify=true
|
||||
|
||||
# Wait for k3s API server to be fully ready
|
||||
echo "==> Waiting for k3s API server..."
|
||||
for i in {1..60}; do
|
||||
kubectl get nodes --request-timeout=2s >/dev/null 2>&1 && break
|
||||
echo " Attempt $i/60..."
|
||||
sleep 1
|
||||
done
|
||||
sleep 2 # Extra buffer for stability
|
||||
|
||||
# Verify k3s is actually working
|
||||
echo "==> Verifying k3s..."
|
||||
kubectl get nodes || { echo "[ERROR] k3s not responding properly"; exit 1; }
|
||||
|
||||
# Wait for node to be Ready
|
||||
echo "==> Waiting for node to be Ready..."
|
||||
for i in {1..30}; do
|
||||
kubectl get nodes 2>/dev/null | grep -q " Ready" && break
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Create namespace
|
||||
echo "==> Creating minikura namespace..."
|
||||
kubectl create namespace minikura --dry-run=client -o yaml | kubectl apply -f - 2>/dev/null || true
|
||||
|
||||
# Uncomment the line below if you need service account token in .env
|
||||
# bash /workspace/.devcontainer/setup-k8s-token.sh
|
||||
|
||||
# Install dependencies
|
||||
echo "==> Installing dependencies..."
|
||||
cd /workspace
|
||||
|
||||
Reference in New Issue
Block a user