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

bgp: support announce policy #3282

Merged
merged 3 commits into from
Oct 8, 2023
Merged

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Oct 7, 2023

What type of this PR

  • Features

Which issue(s) this PR fixes:

Add a new BGP announce policy local.

To use this policy, annotate subnet/pod with ovn.kubernetes.io/bgp=local.

WHAT

🤖 Generated by Copilot at 0286577

This pull request adds BGP integration testing and configuration for kube-ovn. It introduces new Makefile targets and a network topology template for creating a BGP lab with containerlab. It also adds a node name flag and a BGP policy annotation for the speaker component, which announces node subnet routes to the network. It modifies the yamls/speaker.yaml file to pass the node name to the speaker container.

🤖 Generated by Copilot at 0286577

This pull request is quite a feat
It adds BGP policies to syncSubnetRoutes
It uses containerlab to test the integration
And sets the KUBE_NODE_NAME for the speaker configuration
It also adds a flag and a field for the node name to complete

HOW

🤖 Generated by Copilot at 0286577

  • Define a variable CLAB_IMAGE to store the containerlab image name (link)
  • Add a new target kind-init-bgp to create a network topology with a BGP router and two Kubernetes nodes using containerlab (link)
  • Add a new target kind-install-bgp to enable BGP peering and route advertisement on the nodes (link)
  • Add a new target kind-clean-bgp to destroy the network topology and delete the kind cluster and the kube-ovn images (link)
  • Modify the clean target to also remove the yamls/clab-bgp.yaml file (link)
  • Add the strings package to the import list in pkg/speaker/config.go (link)
  • Add a new field NodeName to the Configuration struct in pkg/speaker/config.go (link)
  • Add a new flag --node-name to the ParseFlags function in pkg/speaker/config.go (link)
  • Assign the value of the --node-name flag to the NodeName field and convert it to lower case in the ParseFlags function in pkg/speaker/config.go (link)
  • Modify the syncSubnetRoutes function in pkg/speaker/subnet.go to support different BGP policies specified by the ovn.kubernetes.io/bgp annotation on the subnets and pods (link)
  • Add a new file yamls/clab-bgp.yaml.j2, which is a Jinja2 template for defining the network topology for the BGP test scenario using containerlab (link)
  • Add a new environment variable KUBE_NODE_NAME to the kube-ovn-speaker container in the yamls/speaker.yaml file (link)

@zhangzujian zhangzujian added the feature New network feature label Oct 7, 2023
@zhangzujian zhangzujian linked an issue Oct 7, 2023 that may be closed by this pull request
@zhangzujian zhangzujian marked this pull request as ready for review October 7, 2023 14:28
@zhangzujian zhangzujian requested a review from oilbeater October 7, 2023 14:28
pkg/speaker/subnet.go Outdated Show resolved Hide resolved
Signed-off-by: 张祖建 <[email protected]>
@zhangzujian zhangzujian requested a review from oilbeater October 8, 2023 02:26
@zhangzujian zhangzujian merged commit c493a95 into kubeovn:master Oct 8, 2023
58 checks passed
@zhangzujian zhangzujian deleted the bgp-policy branch October 8, 2023 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New network feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

limit bgp announcements
2 participants