New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpv1: Implement AdvertisedPathAttributes
for CiliumBGPNeighbor
using BGP routing policies
#27705
Conversation
e3de014
to
fc83f1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions to clarify, but overall code and structure looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did an initial look. Thanks! This is cool! I have several questions.
fc83f1f
to
c1b7ae3
Compare
OutgoingRouteAttributes
for CiliumBGPNeighbor
using BGP routing policiesAdvertisedPathAttributes
for CiliumBGPNeighbor
using BGP routing policies
76b1119
to
bbf290a
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concerns are addressed. LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!
bbf290a
to
797f5c7
Compare
… CRD Extend the CiliumBGPNeighbor part of the CiliumBGPPeeringPolicy CRD with a new optional field "AdvertisedPathAttributes" that can be used to apply additional path attributes to selected routes when advertising them to a peer. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
…GoBGP Introduce a new RoutePolicy type representing a BGP routing policy and new Router interface methods AddRoutePolicy + RemoveRoutePolicy. Implement the new RoutePolicy interface in the GoBGP router implementation. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
Introduces a new BGPCPResourceStore that provides and easy to use interface to a resource.Store for k8s objects that needs to be processed by the BGP Control Plane reconcilers. It automatically signals the BGP Control Plane whenever an event happens on the resource, so that individual reconcilers do not need to do that themselves. Also provides a respective mock type that can be used in unit tests. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
Implements a new BGP CP reconciler "PolicyReconciler", that reconciles BGP neighbor's AdvertisedPathAttributes configuration matching CiliumLoadBalancerIPPools and/or PodCIDRs into underlying server's routing policies. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
Adds a new Router interface API method ResetNeighbor(), which can be used to perform soft or hard reset of a BGP peer. Uses this API from the RoutePolicyReconciler upon routing policy changes to take effect immediately. Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
797f5c7
to
d70ce39
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice feature. I have a few nits that can be resolved in a follow-up PR.
This PR adds a new field
AdvertisedPathAttributes
into theCiliumBGPNeighbor
part of theCiliumBGPPeeringPolicy
CRD, which can be used to apply additional NLRI attributes (communities / local preference) to matched routes when advertising them to a BGP peer.The implementation relies on the GoBGP routing policies, which are internally abstracted to a new
RoutePolicy
type and newRouter
interface methodsAddRoutePolicy
+RemoveRoutePolicy
.For now, we support this for routes advertised for k8s LB services (matching by
CiliumLoadBalancerIPPool
s) and Pod CIDRs (matching byCiliumNode
s).For more details, please see the individual commits.
Example:
CiliumBGPPeeringPolicy
configuration:Matching a LB pool:
Causes adding a Community and setting appropriate Local Preference on advertised routes (
10.244.0.0/24
is a pod CIDR and192.168.100.190/32
is a k8s service VIP):(Note that Local Preference attribute is sent only to iBGP peers and defaults to
100
)On the peered router:
Release Note: