23 lines
787 B
Python
23 lines
787 B
Python
import paramiko
|
|
|
|
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} ===")
|
|
stdin, stdout, stderr = ssh.exec_command(cmd)
|
|
print(stdout.read().decode())
|
|
err = stderr.read().decode()
|
|
if err:
|
|
print("ERR:", err)
|
|
|
|
run("kubectl get ingress argo-ing -n infrastructure -o yaml")
|
|
run("kubectl get svc pihole-web -n infrastructure -o yaml")
|
|
run("kubectl get svc -n infrastructure")
|
|
run("kubectl get svc -A | grep -E 'LoadBalancer|140.44.4.62'")
|
|
run("curl -k -I -H 'Host: argo.snarfnet.net' http://140.44.4.62")
|
|
run("curl -k -I -H 'Host: argo.snarfnet.net' https://140.44.4.62")
|
|
ssh.close()
|
|
|