Files
harvester-ui-extension/pkg/harvester/pages/c
mergify[bot]andMarcelo Fukumoto 8b3585c501 feat: add the Kube-OVN BGP speaker under Overlay Networks > Settings and a BGP option on subnets (#1262) (#1274)
* feat: add the Kube-OVN BGP page and a BGP option on subnets

Add an Overlay Networks > BGP page that edits spec.bgp of the
kube-system/kubeovn Configuration: speaker hosts, neighbor IPv4 and IPv6
addresses, neighbor and cluster AS, router ID and next hops. Add a BGP
option to the subnet form that sets or removes the ovn.kubernetes.io/bgp
annotation. Both need Harvester v1.10.0 or later.



* refactor: move the BGP settings into the kubeovn-operator add-on

Every entry under Overlay Networks is a list, and BGP is a single setting
for the whole Kube-OVN install, so show it as a BGP tab in the
kubeovn-operator add-on's config instead of its own page. The tab saves
spec.bgp of the kube-system/kubeovn Configuration before the add-on is
saved, only when it changed and the add-on stays enabled. The subnet BGP
tooltip now points to it.



* feat: make the BGP tab clearer and check each field as it is typed

- Add a BGP Speaker Enabled/Disabled switch. Disabled removes the speaker
  hosts and keeps the other values. An untouched install opens as
  disabled, with empty fields instead of the placeholder values.
- Neighbors are one list of IPv4 or IPv6 addresses, split by family on
  save with duplicates dropped. Next hops are two single fields, one per
  family, under Advanced.
- Show the errors under each field as it is typed, and keep the same
  checks on save. A router ID is rejected when more than one host runs
  the speaker, because every speaker needs its own.
- Only write the Configuration when the form changed.



* fix: save the BGP tab on top of the latest Kube-OVN Configuration

The operator rewrites the Configuration's status about every five minutes,
so the copy loaded with the form went stale and saving it failed with a
conflict when the form had been open for a while. Fetch the latest copy
at save time and apply only spec.bgp to it. After a successful save,
remember it, so pressing Save again after a failed add-on save doesn't
send the Configuration twice.



* feat: warn on the subnet form when no host runs the BGP speaker

Turning BGP on for a subnet has no effect until some host runs the BGP
speaker. When the subnet's BGP option is Enabled and the Kube-OVN
Configuration has no speaker hosts, show a warning that links to the BGP
tab of the kubeovn-operator add-on. If the Configuration can't be read,
show nothing.

The add-on form now shows its tabs once the BGP data is loaded, so a link
to its #bgp tab opens that tab: Tabbed only honours the URL hash when the
tabs first appear.



* refactor: move the BGP speaker to Overlay Networks > Settings

Keep the BGP configuration out of the kubeovn-operator add-on: add an
Overlay Networks > Settings page that lists cluster-wide overlay network
settings as cards, like Advanced > Settings. The BGP Speaker card shows
whether the speaker is off or where it runs and what it peers with, and
its Edit action opens the BGP form on its own page.

The page owns its Save button, so Save stays disabled while the form has
errors. The add-on goes back to its generic form, and the subnet BGP
warning links to the new page. The speaker state the card and the
warning need is read through a kubeovn.io.configuration model.



* fix: show why Save is disabled on the BGP Speaker page

Save stays disabled while the form is invalid, but an empty Speaker Hosts
or Neighbor Addresses showed no error anywhere, and the neighbor list had
no required mark. Mark Neighbor Addresses as required and flag both
fields when they are left empty, like the other required fields.



* fix: show load errors and fix the add-on link on the BGP pages

- The BGP Speaker page showed only its title when the Kube-OVN
  Configuration could not be read, because the error was only shown
  inside the form. Show it on the page. The Settings card now says
  Unknown instead of Disabled in that case.
- The add-on link on the BGP Speaker page was a relative path, which
  resolved under /overlay-network-settings/ and opened the fail-whale.
  Both pages now link to the add-on by route name.
- The subnet form shows its BGP warning under the BGP option, like the
  DHCP banner, instead of in a column of its own.
- The BGP page reads hosts, neighbors and next hops through the model's
  getters instead of parsing them again.
- The "requires v1.10.0" message uses the product name token, and the
  subnet BGP comment and tooltip no longer say that "local" advertises
  the subnet's CIDR block.



* refactor: keep the Kube-OVN model's parsing helpers private

Nothing outside the model uses splitList or the placeholder neighbor
addresses since the BGP page reads the model's getters, so stop
exporting them.



* feat: tell users to label the external gateway hosts on BGP subnets

When BGP is enabled on a subnet, show a note under it: the hosts that
carry external traffic need the label ovn.kubernetes.io/external-gw=true.
It shows next to the existing warning about the BGP speaker having no
hosts.



* feat: separate the IPv4 and IPv6 BGP neighbors

- The BGP Speaker page now has one neighbor list per family, like the
  next hops. Each list only takes addresses of its own family, and one
  neighbor in either list is enough.
- Reject the placeholder neighbors Harvester installs (192.0.2.1 and
  2001:db8::1). The page hides them on load, so a saved one disappeared
  on the next visit and was dropped on the next save.
- Only treat the Configuration as never set up when it holds nothing
  but the installed values. A speaker set up with the private AS numbers
  64512/64513 and then disabled used to reopen with both AS fields blank.



* feat: edit the BGP speaker on the Overlay Network Settings page

Overlay Network Settings showed one card per setting and opened the BGP
speaker on a page of its own. Show the BGP speaker form on the settings
page instead, in an RcSection titled BGP Speaker, with Save and no
Cancel. Another setting would be another section on the same page, under
the same Save. Saving stays on the page and shows what was saved.

Inside the section, follow how the shell's own RcSection forms are
built: the Enabled/Disabled choice has no label of its own (the section
title names it), and the neighbors and the advanced options are nested
secondary sections, with the two neighbor lists under column headers
instead of their own headings.



* fix: reject IPv4 addresses with leading zeros in the BGP speaker

The speaker parses its addresses with Go, which rejects an IPv4 part
written with a leading zero, like 192.0.2.010. The form accepted those
in the IPv4 neighbors, the router ID and the next hops, and nothing on
the backend checks them, so saving one left the speaker unable to start.
Reject them on every address field, including an IPv6 address that ends
in an IPv4 one, and say how to write the address instead.



* feat: show the BGP speaker as its own entry under Overlay Networks

The backend owner asked for BGP to show in the menu by name rather than
behind a Settings entry. Replace Overlay Networks > Settings with an
Overlay Networks > BGP Speaker entry that opens the form directly,
titled BGP Speaker, and point the subnet's BGP warning and tooltip to
it. If more parts of the Kube-OVN Configuration get a form later, they
can move into a Configuration group under Overlay Networks.



---------


(cherry picked from commit 1b562cec41)

Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
Co-authored-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
2026-11-23 11:44:26 +01:00
..