18 lines
628 B
Python
18 lines
628 B
Python
import paramiko
|
|
|
|
key_path = r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet'
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect('140.44.4.41', username='root', key_filename=key_path, timeout=10)
|
|
|
|
stdin, stdout, stderr = ssh.exec_command("k3s kubectl get ds -n kube-system")
|
|
print("Daemonsets in kube-system on Spaceport:")
|
|
print(stdout.read().decode())
|
|
|
|
stdin, stdout, stderr = ssh.exec_command("k3s kubectl describe pod -n kube-system svclb-pihole-web-vip-dafeaccd-2qvp9 | grep -E 'Node:|Events:|failed'")
|
|
print("Describe pending svclb pod:")
|
|
print(stdout.read().decode())
|
|
|
|
ssh.close()
|
|
|