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

View File

@@ -1,19 +1,13 @@
import paramiko
import sys
def check_catalog_versions(ip, cluster_name):
print(f"\n=======================================================")
print(f"=== {cluster_name} AVAILABLE CHART VERSIONS ===")
print(f"=======================================================")
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip, username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
# We can inspect the Rancher catalog charts
cmd = "kubectl get charts.catalog.cattle.io -A -o custom-columns=REPO:.metadata.namespace,CHART:.metadata.name | head -n 30"
_, out, _ = ssh.exec_command(cmd)
print(out.read().decode())
ssh.close()
sys.stdout.reconfigure(encoding='utf-8')
check_catalog_versions('140.44.4.11', 'AERODROME')
check_catalog_versions('140.44.4.41', 'SPACEPORT')
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
client.connect("140.44.4.11", username="root", key_filename=key_path, timeout=15)
stdin, stdout, stderr = client.exec_command("KUBECONFIG=/etc/rancher/k3s/k3s.yaml helm search repo rancher-stable/rancher --versions > /tmp/rancher_versions.txt && head -n 30 /tmp/rancher_versions.txt")
print(stdout.read().decode('utf-8'))
client.close()