30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
import paramiko
|
|
import json
|
|
|
|
def main():
|
|
s = paramiko.SSHClient()
|
|
s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
s.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet')
|
|
|
|
_, o, _ = s.exec_command('kubectl get svc -A -o json')
|
|
data = json.loads(o.read().decode())
|
|
print("=== AERODROME LOADBALANCER SERVICES ===")
|
|
for item in data.get('items', []):
|
|
if item.get('spec', {}).get('type') == 'LoadBalancer':
|
|
name = item['metadata']['name']
|
|
ns = item['metadata']['namespace']
|
|
lb_ip = item.get('spec', {}).get('loadBalancerIP')
|
|
ing = [x.get('ip') for x in item.get('status', {}).get('loadBalancer', {}).get('ingress', [])]
|
|
annotations = item['metadata'].get('annotations', {})
|
|
print(f"- {ns}/{name}: status_ingress={ing}, spec_loadBalancerIP={lb_ip}, metallb_annotations={list(annotations.keys())}")
|
|
|
|
_, o, _ = s.exec_command('kubectl get ipaddresspools.metallb.io -A -o yaml 2>/dev/null || kubectl get cm -n metallb-system config -o yaml 2>/dev/null || true')
|
|
print("\n=== METALLB CONFIG ===")
|
|
print(o.read().decode())
|
|
|
|
s.close()
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|