feat: add scripts to inspect and check Rancher deployments via SSH

This commit is contained in:
2026-11-04 21:26:45 -05:00
parent 1b378b29f3
commit ba47f6a384
10 changed files with 210 additions and 15 deletions

34
scripts/rancher_status.py Normal file
View File

@@ -0,0 +1,34 @@
import paramiko
import sys
sys.stdout.reconfigure(encoding='utf-8')
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
try:
client.connect("140.44.4.11", username="root", key_filename=key_path, timeout=10)
print("=== Connected to Aerodrome (140.44.4.11) ===")
cmds = [
"kubectl -n cattle-system get pods -o wide",
"helm list -n cattle-system",
"helm repo list",
"k3s etcd-snapshot list"
]
for cmd in cmds:
print(f"\n--- Running: {cmd} ---")
stdin, stdout, stderr = client.exec_command(f"KUBECONFIG=/etc/rancher/k3s/k3s.yaml {cmd}")
out = stdout.read().decode('utf-8')
err = stderr.read().decode('utf-8')
if out:
print(out.strip())
if err:
print(f"ERR: {err.strip()}")
client.close()
except Exception as e:
print(f"Error: {e}")