feat: add infrastructure health check and management automation scripts

This commit is contained in:
2026-11-05 10:13:07 -05:00
parent 14fac7151f
commit 1fce3f2488
79 changed files with 1391 additions and 20 deletions

View File

@@ -1,16 +1,19 @@
import paramiko
import sys
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('140.44.4.41', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
sys.stdout.reconfigure(encoding='utf-8')
def run(cmd):
print(f"=== {cmd} ===")
stdin, stdout, stderr = ssh.exec_command(cmd)
print(stdout.read().decode())
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect("140.44.4.41", username="root", key_filename=key_path, timeout=10)
run("kubectl get pods -A | grep -v -E 'Running|Completed' || true")
run("kubectl get volumes.longhorn.io -n longhorn-system -o custom-columns=NAME:.metadata.name,ROBUSTNESS:.status.robustness,STATE:.status.state")
run("kubectl get applications -A -o custom-columns=NAME:.metadata.name,SYNC:.status.sync.status,HEALTH:.status.health.status")
ssh.close()
stdin, stdout, stderr = client.exec_command('k3s kubectl get pods -n cattle-system')
print("=== SPACEPORT CATTLE-SYSTEM PODS ===")
print(stdout.read().decode('utf-8'))
stdin, stdout, stderr = client.exec_command('k3s kubectl get nodes')
print("=== SPACEPORT NODES ===")
print(stdout.read().decode('utf-8'))
client.close()