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: Introduce generic bgp manager layer #25016
Conversation
b879e31
to
7192f89
Compare
7192f89
to
6441ad7
Compare
@harsimran-pabla I have no major objections to these changes. I like the idea of creating a generic layer, and the initial set of changes are palpable. I think we get these changes upstream, and then back down stream, we can continue in this direction. |
/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.
general nit, acronyms should be fully capitalized.
s/Asn/ASN
s/Bgp/BGP
and any others.
6441ad7
to
9291ef8
Compare
@ldelossa Some of the parameters are in gobgp API, which are defining ASN as Asn. :( |
Aha! totally missed that. Okay, disregard :). |
/test |
23f76e2
to
cc3955a
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.
LGTM!
/test-runtime |
/test-1.26-net-next |
pkg/bgpv1/types/bgp.go
Outdated
// WithdrawPath method, making withdrawing an advertised route simple. | ||
type Advertisement struct { | ||
Net *net.IPNet | ||
PathUuid []byte // path identifier in underlying implementation |
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.
If this is GoBGP-specific, how about making it clear by name? Like GoBGPPathUuid
?
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.
And UUID is an acronym, so can be capitalized.
pkg/bgpv1/types/bgp.go
Outdated
type BGPGlobal struct { | ||
ASN uint32 | ||
RouterID string | ||
ListenPort int32 |
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.
Better to document why this is signed 32bit (port number is unsigned 16bit in principle) and -1
has a special meaning.
I could find some gobgp leftover under the manager package. Some of them are necessary (e.g. NewGoBGPServerWithConfig), but others are not, I think (e.g. "component" field of the log).
Also, we should update the |
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.
Made some comments. Most of them are very easy to fix I believe. Otherwise, looks very nice to me 👍
cc3955a
to
4fc8456
Compare
/test |
pkg/bgpv1/types/bgp.go
Outdated
// The `Net` field makes comparing this Advertisement with another IPNet encoded | ||
// prefixes simple. | ||
// | ||
// The `GoBGPPathUUID` field is a gobgp.GoBGPPathUUID object which can be forwarded to gobgp's |
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.
Nit: gobgp.GoBGPPathUUID => gobgp.PathUUID?
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.
oh this is result of goland magic refactor :)
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.
Now LGTM! @dylandreimerink I'm sorry, I accidentally re-requested your review. Please approve again if necessary 🙇
Introduce new manager layer, which decouples itself from gobgp structures. Also, using UUID in identifying paths instead of gobgp path pointers. This change is mostly refactoring code and not introducing any functionality. Signed-off-by: harsimran pabla <hpabla@isovalent.com>
4fc8456
to
c7f4cbc
Compare
/test |
Updating BGP documentation to match refactor done in cilium#25016. Signed-off-by: harsimran pabla <hpabla@isovalent.com>
Updating BGP documentation to match refactor done in #25016. Signed-off-by: harsimran pabla <hpabla@isovalent.com>
Updating BGP documentation to match refactor done in cilium#25016. Signed-off-by: harsimran pabla <hpabla@isovalent.com>
BGP subsystem refactor
TLDR
Introducing new manager layer in BGP subsystem, which decouples itself from gobgp structures. Also, using UUID in identifying paths instead of gobgp path pointers. This change is mostly refactoring code and not introducing any functionality.
Motivation/Problem Statement
The BGP subsystem was designed to be modular and support multiple BGP backends. In current architecture, BGP subsystem comprises of three parts controller, reconcilers, and the route manager. Controller works on Kubernetes specific events, whereas reconcilers and route manager use gobgp specific structures.
There is heavy usage of gobgp library in reconcilers and route manager. This raises few concerns
Goal
Introduce cilium specific BGP types and use those in reconcilers.
Change
This change introduces new manager layer and BGP types which are cilium specific.
Impact
There is no functional impact of this change.