-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathESEGUI-QUESTO-COMANDO.sh
More file actions
executable file
·57 lines (48 loc) · 2.04 KB
/
ESEGUI-QUESTO-COMANDO.sh
File metadata and controls
executable file
·57 lines (48 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# QUESTO SCRIPT RISOLVE IL 502 BAD GATEWAY
# Esegui con: sudo ./ESEGUI-QUESTO-COMANDO.sh
echo "═══════════════════════════════════════════════════════════"
echo " FIX 502 BAD GATEWAY - Import Nuova API con Auth Endpoints"
echo "═══════════════════════════════════════════════════════════"
echo ""
# Verifica che sia eseguito con sudo
if [ "$EUID" -ne 0 ]; then
echo "❌ ERRORE: Questo script deve essere eseguito con sudo"
echo ""
echo "Esegui: sudo ./ESEGUI-QUESTO-COMANDO.sh"
exit 1
fi
echo "✅ Running as root"
echo ""
# Step 1: Import image
echo "📦 Importing API image to K3s..."
if [ ! -f "/tmp/insightlearn-api.tar" ]; then
echo "❌ Errore: /tmp/insightlearn-api.tar non trovata"
echo " L'immagine dovrebbe essere stata creata da Claude."
echo " Verifica che esista con: ls -lh /tmp/insightlearn-api.tar"
exit 1
fi
/usr/local/bin/k3s ctr images import /tmp/insightlearn-api.tar
if [ $? -ne 0 ]; then
echo "❌ Import fallito!"
exit 1
fi
echo ""
echo "✅ Image imported successfully!"
echo ""
# Verify
echo "📋 Verifico immagine importata..."
/usr/local/bin/k3s ctr images ls | grep insightlearn
echo ""
echo "═══════════════════════════════════════════════════════════"
echo " Import completato! Ora riavvia i pod API"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "Esegui (come utente normale, NON sudo):"
echo ""
echo " kubectl delete pod -n insightlearn -l app=insightlearn-api"
echo ""
echo "Poi attendi che i nuovi pod siano pronti:"
echo ""
echo " kubectl get pods -n insightlearn -w"
echo ""