Repository navigation
Description
In metallb/metallb#114, I explored how to make my k8s BGP load-balancer interoperate gracefully with Calico clusters that peer with external BGP routers. I've documented my findings at https://master--metallb.netlify.com/configuration/calico/ and metallb/metallb#114 (comment)
Current Behavior
In my setup, I'm trying to peer Calico with another BGP speaker running on localhost. The peer does not listen on any ports, so Calico should just wait for an incoming session. Currently, there is no way to tell Calico to treat a peer passively, so Calico always eagerly tries to connect to 127.0.0.1:179... which is itself. This causes repeated session establishment failures, and BIRD goes into error backoff. This makes it increasingly hard/impossible for the real peer to connect, there's a short window of just a few seconds when the error backoff resets, before the failed connection attempts force it back into backoff.
Expected Behavior
Calico should have a way to specify that a bgpPeer is passive, i.e. Calico should not try to connect to it, but instead just wait for a matching incoming connection.
BIRD supports this, with the passive keyword. It's just not plumbed into the bgpPeer object.
Context
I am trying to make Calico and MetalLB integrate nicely with each other, by setting up a BGP topology like the one I documented for Romana integration. Basically, I want Calico to peer with the outside world, but also with another node agent that pushes routes into Calico for redistribution.
Setting up BGP sessions to/from localhost is notoriously tricky, but with the right set of options, it's possible. Lack of passive mode is one problem I encountered with Calico.
Your Environment
- Calico version: 2.6.3
- Orchestrator version (e.g. kubernetes, mesos, rkt): Kubernetes 1.9.1
- Operating System and version: Debian testing
- Link to your project (optional): https://github.com/google/metallb
Activity
caseydavenport commentedon Jan 16, 2018
Exposing the
passivekeyword on theBGPPeerresource should be straightforward and seems sensible enough to me.We'd need to:
stevegaossou commentedon Mar 6, 2019
Hey @danderson, we're revisiting this issue and trying to reproduce the problem (i.e. error backoff due to repeated session establishment failures) using the latest versions of Calico and MetalLB with the minikube setup from the MetalLB tutorial.
The goal is to reproduce this problem first as a validation step before getting the "passive" mode added to bgp peer.
However, using the setup below, I wasn't able to reproduce the error backoff that leads to difficulty with real peer connection establishment.
Your Environment
Cluster Setup
The sequence for the setup was:
Before configuring metalb speaker with peering to 127.0.0.1, I had the calico-node peering to 127.0.0.1 to simulate the problem of calico-node peering with itself, i.e. "repeated session establishment failures".
However, I couldn't seem to reproduce an error backoff in the calico-node. Connection retries were evident from the calico-node logs:
However there was no indication from the logs that BIRD had entered error backoff.
Afterwards, initiating a peering from the metallb speaker resulted in an established connection with calico-node without any issues.
Let me know if I'm missing something important in reproducing this.
stevegaossou commentedon Mar 7, 2019
Just a heads up to anyone reading. The most recent relevant discussion is here:
metallb/metallb#114 (comment)
kfox1111 commentedon Mar 8, 2020
Any updates on this?
demonsked commentedon Apr 16, 2020
Really need that functionality.
psavva commentedon Jun 5, 2020
I am also interested in this.
+1 from me
stephenstubbs commentedon Sep 4, 2020
I would also like to see this issue resolved.
caseydavenport commentedon Sep 4, 2020
Still looking for someone to work on this! Would love to review.
The first PR to add the new configuration option would look similar to this one: https://github.com/projectcalico/libcalico-go/pull/1262/files
darkrift commentedon Jan 19, 2022
Looking at #160, projectcalico/libcalico-go#886 and metallb/metallb#114 it seems there is some way to make this work.
Is this still an issue ?
caseydavenport commentedon Jan 21, 2022
@darkrift correct - we've implemented an integration with MetalLB that bypasses the need for explicitly setting passive mode on the BGP peers. So, this issue doesn't block MetalLB integration any more.
We don't yet have an option to set passive mode explicitly per-peer, but the use-case that this was meant to cover works now without it. I've left it open for now in case anyone wants to tackle adding this for another use-case, but the original MetalLB scenario is fixed 👍
cyclinder commentedon Jul 27, 2022
@caseydavenport I am interested in this, but I need to know what else needs to be done here, can you tell me? Thanks.
caseydavenport commentedon Jul 27, 2022
@cyclinder so far as implementing a passive mode option, this is a similar type of PR, and would look similar to what this would entail: #5736
Summary is probably something like this:
connectMode: Passive | Active, would need some agreement on the name but shouldn't be too controversial)passive onif told to do so.github-actions commentedon Aug 18, 2025
This issue is stale because it is kind/enhancement or kind/bug and has been open for 180 days with no activity.
github-actions commentedon Sep 18, 2025
This issue was closed because it has been inactive for 30 days since being marked as stale.