feat(vip): lock MetalLB LoadBalancer VIPs across Aerodrome and Spaceport (Pillar 2 completed)
This commit is contained in:
29
scripts/check_aerodrome_vip_details.py
Normal file
29
scripts/check_aerodrome_vip_details.py
Normal file
@@ -0,0 +1,29 @@
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user