#!/bin/bash # Status check across every namespace actually in use by this cluster. # Usage: ./shfiles/check-k8s-status.sh NAMESPACES=(core nearle alaska doormile kubernetes-dashboard) echo "==========================================" echo "🔍 KUBERNETES DEPLOYMENT STATUS" echo "==========================================" echo "" echo "📦 1. NODES" echo "-----------------------------------" kubectl get nodes -o wide echo "" echo "📦 2. PODS (All Namespaces)" echo "-----------------------------------" kubectl get pods -A -o wide echo "" for ns in "${NAMESPACES[@]}"; do echo "==========================================" echo "📦 Namespace: ${ns}" echo "==========================================" echo "-- Pods --" kubectl get pods -n "${ns}" -o wide 2>/dev/null || echo " (namespace not found)" echo "" echo "-- Services --" kubectl get svc -n "${ns}" -o wide 2>/dev/null echo "" echo "-- StatefulSets / Deployments --" kubectl get statefulsets,deployments -n "${ns}" -o wide 2>/dev/null echo "" echo "-- HPA / PodDisruptionBudgets --" kubectl get hpa,pdb -n "${ns}" 2>/dev/null echo "" echo "-- Recent Events (last 10) --" kubectl get events -n "${ns}" --sort-by='.lastTimestamp' 2>/dev/null | tail -10 echo "" done echo "🌍 GATEWAY / HTTPROUTE / INGRESS (All Namespaces)" echo "-----------------------------------" kubectl get gateway -A 2>/dev/null || echo "No Gateway API resources found" kubectl get httproute -A 2>/dev/null || echo "No HTTPRoute resources found" kubectl get ingress -A 2>/dev/null || echo "No Ingress resources found" echo "" echo "💾 RESOURCE USAGE (CPU/Memory)" echo "-----------------------------------" kubectl top pods -A 2>/dev/null || echo "Metrics server not available" kubectl top nodes 2>/dev/null || echo "Metrics server not available" echo "" echo "==========================================" echo "✅ Status Check Complete!" echo "=========================================="