feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
34
scripts/fix_cluster_issues.py
Normal file
34
scripts/fix_cluster_issues.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
# 1. Install open-iscsi on sninfr2lnxwrk01 (140.44.4.21)
|
||||
print("=== INSTALLING OPEN-ISCSI ON WRK01 (140.44.4.21) ===")
|
||||
ssh_wrk01 = paramiko.SSHClient()
|
||||
ssh_wrk01.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh_wrk01.connect('140.44.4.21', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=8)
|
||||
stdin, stdout, stderr = ssh_wrk01.exec_command('apt-get update -qq && apt-get install -y open-iscsi nfs-common && systemctl enable --now iscsid')
|
||||
print(stdout.read().decode())
|
||||
print("iscsid status:", end=" ")
|
||||
_, out, _ = ssh_wrk01.exec_command('systemctl is-active iscsid')
|
||||
print(out.read().decode().strip())
|
||||
ssh_wrk01.close()
|
||||
|
||||
# 2. Check on Master
|
||||
ssh_master = paramiko.SSHClient()
|
||||
ssh_master.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh_master.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=8)
|
||||
|
||||
print("=== DELETING CRASHING LONGHORN-MANAGER-SQTL9 POD SO IT RECREATES WITH ISCSID ===")
|
||||
ssh_master.exec_command('kubectl delete pod -n longhorn-system longhorn-manager-sqtl9')
|
||||
|
||||
print("=== CHECKING HELM-INSTALL-TRAEFIK-CRD LOGS ===")
|
||||
_, out, _ = ssh_master.exec_command('kubectl logs -n kube-system helm-install-traefik-crd-jt9zk --tail=25')
|
||||
print(out.read().decode())
|
||||
|
||||
print("=== CLEANING 130-DAY UNKNOWN PODS IN INFRA ===")
|
||||
ssh_master.exec_command('kubectl delete pod -n infra pihole-85b7bd696d-ltrvg technitium-dns-6dcf8fc9f6-mxd7p --force --grace-period=0')
|
||||
|
||||
ssh_master.close()
|
||||
|
||||
Reference in New Issue
Block a user