Skip to content
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

bgpv2: Adding preflight and neighbor reconcilers using CiliumBGPNodeConfig CRD. #30108

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

harsimran-pabla
Copy link
Contributor

@harsimran-pabla harsimran-pabla commented Jan 4, 2024

This change introduces scaffolding for BGPv2 reconcilers, starting with preflight and neighbor reconcilers. At later stage, other reconcilers will be added.

Change includes two commits

  • First commit introduces preflight and neighbor reconcilers. Along with the unit tests.
  • Second commit adds ReconcileInstances API to BGPRouteManager. Along with all the changes required to manage BGP instances.
bgpv2 - adding preflight and neighbor reconciler using CiliumBGPNodeConfig resource.

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 4, 2024
@harsimran-pabla harsimran-pabla added area/bgp release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Jan 4, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 4, 2024
Copy link
Contributor

@rastislavs rastislavs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I have some non-critical comments, but overall the approach makes sense to me.

pkg/bgpv1/manager/instance/instance.go Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/preflight.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/preflight.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/workdiff.go Outdated Show resolved Hide resolved
@harsimran-pabla harsimran-pabla marked this pull request as ready for review January 5, 2024 19:34
@harsimran-pabla harsimran-pabla requested a review from a team as a code owner January 5, 2024 19:34
@harsimran-pabla
Copy link
Contributor Author

/test

Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay 🙇

Made an initial review. Thanks for working on this!

pkg/bgpv1/manager/reconcilerv2/neighbor.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/preflight.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/preflight.go Show resolved Hide resolved
@harsimran-pabla harsimran-pabla force-pushed the hpabla/bgp/v2/manager branch 2 times, most recently from 921387b to de3abe0 Compare January 18, 2024 22:30
@harsimran-pabla
Copy link
Contributor Author

Thanks @YutaroHayakawa for the review. I think all of them are addressed. One significant change is new logger package under bgpv1/, I think it makes sense to put all the k/v variables in one place so logging is consistent across BGP sub-system.

Let me know if this makes sense. cc @rastislavs

Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a second review. Thanks for the fix!

pkg/bgpv1/logger/log.go Outdated Show resolved Hide resolved
pkg/bgpv1/logger/log.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Show resolved Hide resolved
@harsimran-pabla harsimran-pabla force-pushed the hpabla/bgp/v2/manager branch 2 times, most recently from b934469 to 4ccdda7 Compare January 23, 2024 18:49
Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a third review. I added a comment for the issue I found while I was working for this PR #30382.

Since we derived new reconcilers from the v1 reconciler, it obviously contains these issues we had in the bgpv1. I started to wonder how much of the issue we want to solve in this PR.

One option is, we only fix "critical" issues and let rest of the fixes to go into the follow-up if we can do that later. The cons of this approach is it is very easy to deprioritize the follow-up once this feature starts to "work". In that sense, we should solve any concern in this PR. WDYT?

pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Show resolved Hide resolved
Introducing preflight and neighbor reconciler using CiliumBGPNodeConfig
and CiliumBGPPeerConfig resources. Reconcilers are added in reconcilerv2
pkg.

Preflight reconciler is used to create, delete and update BGP instances.
It differs from BGPv1 preflight reconciler. It overrides RouterID and
listening port from CiliumBGPNodeConfig, if they are set.

Neighbor reconciler is used to create, delete and update BGP peer
configuration per instance. It differs from BGPv1 reconciler in terms to
metadata storage and how peer configuration is created. In case of v2
reconcilers, peer configuration is fetched from CiliumBGPPeerConfig CRD
resource.

These reconcilers will need to be registered with BGP cell, this will be
done in future changes.

Signed-off-by: harsimran pabla <[email protected]>
@harsimran-pabla harsimran-pabla force-pushed the hpabla/bgp/v2/manager branch 2 times, most recently from 6bdea43 to ce0c626 Compare January 24, 2024 20:02
Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is my last review 🙏

pkg/bgpv1/manager/manager.go Outdated Show resolved Hide resolved
pkg/bgpv1/manager/manager.go Show resolved Hide resolved
pkg/bgpv1/manager/reconcilerv2/neighbor.go Show resolved Hide resolved
This change introduces new API ReconcileInstances to BGPRouteManager.
This API will be called by controller when BGPv2 is enabled and
reconciliation is triggered.

New BGPv2 equivalent methods are added to workdiff and BGPRouteManager.
This is done because new configuration is based on CiliumBGPNodeConfig
instead of CiliumBGPPeeringPolicy.

Signed-off-by: harsimran pabla <[email protected]>
Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, LGTM. Thanks!

@harsimran-pabla
Copy link
Contributor Author

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 29, 2024
@julianwiedmann julianwiedmann added this pull request to the merge queue Jan 29, 2024
Merged via the queue into cilium:main with commit 2d7b909 Jan 29, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bgp ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants