feat: add various infrastructure and service diagnostic scripts
This commit is contained in:
27
scripts/restart_and_verify_sso.py
Normal file
27
scripts/restart_and_verify_sso.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import paramiko
|
||||
import time
|
||||
|
||||
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)
|
||||
|
||||
print("Restarting deployment/technitium-dns...")
|
||||
ssh.exec_command('k3s kubectl rollout restart deployment/technitium-dns -n dns')
|
||||
time.sleep(12)
|
||||
|
||||
# Wait for pod ready
|
||||
stdin, stdout, stderr = ssh.exec_command('k3s kubectl wait --for=condition=Ready pod -l app=technitium-dns -n dns --timeout=30s')
|
||||
print("Wait condition:", stdout.read().decode())
|
||||
|
||||
# Test GET /sso/login
|
||||
stdin, stdout, stderr = ssh.exec_command('k3s kubectl exec -n dns deployment/technitium-dns -- curl -v "http://localhost:5380/sso/login"')
|
||||
print("GET /sso/login result:")
|
||||
print(stderr.read().decode('utf-8', errors='ignore'))
|
||||
print(stdout.read().decode('utf-8', errors='ignore'))
|
||||
|
||||
# Check recent logs
|
||||
stdin, stdout, stderr = ssh.exec_command('k3s kubectl exec -n dns deployment/technitium-dns -- tail -n 25 /var/log/technitium/dns/2026-11-06.log 2>/dev/null || true')
|
||||
print("Recent logs:")
|
||||
print(stdout.read().decode('utf-8', errors='ignore'))
|
||||
|
||||
ssh.close()
|
||||
Reference in New Issue
Block a user