-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstatus.sh
More file actions
44 lines (36 loc) · 1.21 KB
/
Copy pathstatus.sh
File metadata and controls
44 lines (36 loc) · 1.21 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
#!/bin/bash
set -e
echo "📊 DiagnoAI Cluster Status"
# Check if k3s is running
if sudo systemctl is-active k3s >/dev/null 2>&1; then
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
echo ""
echo "📦 Pods:"
kubectl get pods -n diagnoai -o wide
echo ""
echo "🔧 Services:"
kubectl get svc -n diagnoai
echo ""
echo "💾 PVCs:"
kubectl get pvc -n diagnoai
echo ""
echo "📈 Deployments:"
kubectl get deployments -n diagnoai
# Check application health if running
if kubectl get deployment diagnoai -n diagnoai &>/dev/null; then
echo ""
echo "🏥 Application Health:"
POD_NAME=$(kubectl get pods -n diagnoai -l app=diagnoai -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")
if [ -n "$POD_NAME" ]; then
kubectl exec -it $POD_NAME -n diagnoai -- curl -s http://localhost:8000/health || echo "Health check failed"
else
echo "No running pods found"
fi
fi
NODE_IP=$(hostname -I | awk '{print $1}')
echo ""
echo "🌐 Access URL: http://$NODE_IP:30080"
else
echo "❌ k3s cluster is not running"
echo "💡 Use the start-cluster.sh script to start the cluster"
fi