feat: add scripts for k3s cluster upgrade and health checks via AWX and SSH
This commit is contained in:
20
scripts/verify_cluster_health.py
Normal file
20
scripts/verify_cluster_health.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
cmds = [
|
||||
"kubectl get pods -n kube-system",
|
||||
"kubectl get pods -n awx",
|
||||
"kubectl get pods -n infra",
|
||||
"kubectl get volumes.longhorn.io -n longhorn-system -o custom-columns=NAME:.metadata.name,STATE:.status.state,ROBUSTNESS:.status.robustness | head -n 15"
|
||||
]
|
||||
|
||||
for cmd in cmds:
|
||||
print(f"\n=== {cmd} ===")
|
||||
stdin, stdout, stderr = ssh.exec_command(cmd)
|
||||
print(stdout.read().decode())
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user