allow announcing smaller k8s service ip routes
#10 711 ouverte le 21 juil. 2025
Métriques du dépôt
- Stars
- (7 292 étoiles)
- Métriques de merge PR
- (Merge moyen 7j 23h) (256 PRs mergées en 30 j)
Description
We are currently investigating announcing kubernetes service ips via calico-node (replacing metallb).
An issue we are encountering is that calico announces the full service range (e.g. bgpconfigurations.spec.serviceLoadBalancerIPs) for externalTrafficPolicy: Cluster services to the peers.
This conflicts with the anycast failover mechanism between datacenters we are using as routes of failed services are not withdrawn.
Would it be possible to add a configuration to calico that changes the behavior to only announce /32 routes based on existing service.status.LoadBalancer.Ingress.ip within the configured bgpconfiguration.serviceLoadBalancerIPs (and externalip equivalents) if any ready endpoints for externalTrafficPolicy Cluster service exists.
For example:
kind: BGPConfiguration
spec:
singleIPAnnouncement: true
serviceLoadBalancerIPs:
- cidr: 192.168.1.0/24
Would then instead of only announcing the single /24 route, would instead only announce multiple /32 routes per ready service.
The implementation appears to be rather simple as the core logic basically already exists for externalTrafficPolicy: Local services: https://github.com/projectcalico/calico/blob/master/confd/pkg/backends/calico/routes.go#L485