feat: add cluster auditing, management, and upgrade scripts

This commit is contained in:
2026-11-04 17:58:07 -05:00
parent 8117326b14
commit 1b378b29f3
128 changed files with 4744 additions and 1 deletions

24
scripts/upgrade_coder.py Normal file
View File

@@ -0,0 +1,24 @@
import paramiko
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)
def run(cmd):
print(f"=== {cmd} ===")
_, out, err = ssh.exec_command(cmd)
res = out.read().decode().strip()
if res:
print(res)
e = err.read().decode().strip()
if e:
print("ERR:", e)
print("[*] Upgrading Coder to v2.38.6 on Spaceport...")
run("kubectl set image deployment/coder coder=ghcr.io/coder/coder:v2.38.6 -n infrastructure")
run("kubectl rollout status deployment/coder -n infrastructure --timeout=180s")
run("kubectl get pods -n infrastructure -l app.kubernetes.io/name=coder -o wide")
run("curl -k -s -I https://coder.snarfnet.net | head -n 8")
ssh.close()