31 lines
1.2 KiB
Python
31 lines
1.2 KiB
Python
import paramiko
|
|
import time
|
|
|
|
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('utf-8', errors='replace').strip()
|
|
if res:
|
|
print(res)
|
|
e = err.read().decode('utf-8', errors='replace').strip()
|
|
if e:
|
|
print("ERR:", e)
|
|
|
|
print("[*] Annotating applications with argocd.argoproj.io/refresh: hard...")
|
|
# Trigger hard refresh on root and workload apps
|
|
run("kubectl annotate app -n infrastructure root-app-of-apps aerodrome-workloads spaceport-workloads argocd.argoproj.io/refresh=hard --overwrite")
|
|
run("kubectl annotate app -n infrastructure --all argocd.argoproj.io/refresh=hard --overwrite")
|
|
|
|
print("[*] Waiting 15 seconds for ArgoCD repo-server and controller reconciliation...")
|
|
time.sleep(15)
|
|
|
|
print("[*] Checking ArgoCD applications sync & health status...")
|
|
run("kubectl get applications -n infrastructure -o custom-columns=NAME:.metadata.name,SYNC:.status.sync.status,HEALTH:.status.health.status,MESSAGE:.status.conditions[0].message")
|
|
|
|
ssh.close()
|
|
|