Skip to content

feat(ip-query-server): lb of masters added to firewall use_local_firewall#693

Open
leblancmeneses wants to merge 1 commit intovitobotta:mainfrom
leblancmeneses:leblanc/lb_ips
Open

feat(ip-query-server): lb of masters added to firewall use_local_firewall#693
leblancmeneses wants to merge 1 commit intovitobotta:mainfrom
leblancmeneses:leblanc/lb_ips

Conversation

@leblancmeneses
Copy link

feat(ip-query-server): lb of masters added to firewall when private_network false and create_load_balancer_for_the_kubernetes_api: true, use_local_firewall: true

Modified ip-query-server/app.rb to:
- Fetch load balancer IPs from Hetzner API (/v1/load_balancers)
- Filter to only include LBs whose targets include master nodes (by checking server IDs or label selectors with role=master)
- Include LB IPs in the "all" IPs response
- Added new ?role=loadbalancer filter option

How it filters LBs:

The code checks if a load balancer targets master nodes by:

  1. Checking if target.type == 'server' and the server ID matches a master server ID
  2. Checking if target.type == 'label_selector' and the selector contains role=master

This ensures that Istio ingress LBs and other unrelated load balancers are excluded - only the K8s API load balancer (which targets the 3 master nodes) is included.

Without this I could not connect to my cluster from my machine using kubectl

…etwork false and create_load_balancer_for_the_kubernetes_api: true
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant