Skip to content

CFP: Auto Peer Discovery for Cilium BGP #37315

@sokayNY

Description

@sokayNY

Cilium Feature Proposal

Thanks for taking time to make a feature proposal for Cilium! If you have usage questions, please try the slack channel and see the FAQ first.

Is your proposed feature related to a problem?

BGP peering with Cilium is very manual process due to hardcoded peer ip address. For large deployments such as 30k+ nodes,we need to figure out the ToR(Rack-Switch) Switch ip address and hardcoded in CiliumBGPClusterConfig and if there is a change then we need to revisit those files to update our bgp peering ip address and redeploy.

Describe the feature you'd like

I wold like BGP cilium to enable bgp peering via default gw ip address once an operator decided to use BGP unless peer-ip address manually has been defined. So the action would be if no peer-ip address defined, then figure out the gw ip address and try to establish bgp session with the GW, if peerAddress is defined, then send bgp open messages to the defined ip address.

(Optional) Describe your proposed solution

gocast repo seems has the solution by getting the gw ip address first before confifguring bgp.

func NewController(config c.BgpConfig) (*Controller, error) {
	c := &Controller{}
	var gw net.IP
	var err error
	if config.PeerIP == "" {
		gw, err := gateway()
		if err != nil {
			return nil, fmt.Errorf("Unable to get gw ip: %v", err)
		}
		c.peerIP = gw
	} else {
		c.peerIP = net.ParseIP(config.PeerIP)
	}

similar approach would be very useful here too. As we discussed in the cilum slack channel, since cilium have the capability to carry out both ipv4 and ipv6 over the same nexthop, we can set the default peering for ipv4 address family only.

Once we have cilium figured out the gw and send open message to the that ip address. as depicted in the diagram my peerip address should be discovered as 192.168.1.1 unless i manually hardcoded it.

Image

Metadata

Metadata

Labels

area/bgpImpacts the Border Gateway Protocol feature.kind/cfpCilium Feature Proposalkind/featureThis introduces new functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions