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

Extended Visibility for Host Routing #96

Open
chdxD1 opened this issue Feb 15, 2024 · 5 comments
Open

Extended Visibility for Host Routing #96

chdxD1 opened this issue Feb 15, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@chdxD1
Copy link
Member

chdxD1 commented Feb 15, 2024

As of today we have to connect to all nodes one-by-one, open vtysh and run debug commands. This is a rather tedious process.

I'd like to propose an API endpoint on each of the monitoring containers (where it is probably best suited because we already have a vtysh connection and methods around querying it) that gathers this information on each node.

In addition to that there should be another endpoint that allows retrieving information from all nodes in a cluster by querying just one network-operator pod, this could be achieved by using Kubernetes service or pod discovery.

List of commands that should be implemented (all output can be returned as is, without any sanitization):

  • show ip/ipv6 route (vrf <vrf>) <input> json (with/without longer-prefixes)
  • show bgp (vrf <vrf>) ipv4/ipv6 unicast <input> json (with/without longer-prefixes)
  • show evpn vni json
  • show evpn rmac vni <all|vrf> json
  • show evpn mac vni <all|vrf> json
  • show evpn next-hops vni <all|vrf> json
  • show bgp vrf <all|vrf> summary json
@p-strusiewiczsurmacki-mobica
Copy link
Contributor

I was finally able to start working on this. Just created WIP PR.

For now there are 3 GET endpoints.

Endpoint /show/route:

  • show ip/ipv6 route (vrf <vrf>) <input> json (with/without longer-prefixes)

Example: /show/route?protocol=<ip/ipv6>&vrf=<vrf>

Can you tell me what <input> is and how to switch between with/without longer-prefixes. Or point me to the docs, as I can't find this.

Endpoint: /show/bgp

  • show bgp (vrf <vrf>) ipv4/ipv6 unicast <input> json (with/without longer-prefixes)

Example: /show/bgp?vrf=<vrf>&protocol=<ipv4/ipv6>

Same question about <input> and prefixes applies here. Also, will

show bgp vrf all ipv4/ipv6 unicast <input> json

be a valid command?

  • show bgp vrf <all|vrf> summary json

|> Example: /show/bgp?vrf=<vrf>&type=summary

Endpoint /show/evpn:

  • show evpn vni json

Example: /show/evpn

  • show evpn rmac vni <all|vrf> json

Example: /show/evpn?type=rmac&vrf=<vrf>

  • show evpn mac vni <all|vrf> json

Example: Example: /show/evpn?type=mac&vrf=<vrf>

  • show evpn next-hops vni <all|vrf> json

Example: Example: /show/evpn?type=next-hops&vrf=<vrf>

@chdxD1
Copy link
Member Author

chdxD1 commented Mar 5, 2024

@p-strusiewiczsurmacki-mobica <input> will be a CIDR in the form of <IP>/<length> e.g. 192.168.0.0/16, 0.0.0.0/0, 2a01::/64 (for IPv6). To switch between longer-prefixes mode prepend json with longer-prefixes --> show ip route vrf Vrf_test 192.168.0.0/16 longer-prefixes json

It would be good to sanitise the values, input should be parsed through net.ParseCIDR.

Example: /show/route?protocol=<ip/ipv6>&vrf=&cidr/input=&longer_prefixes=true/false

@p-strusiewiczsurmacki-mobica
Copy link
Contributor

@chdxD1 OK, I've made changes you've requested (I hope it'll be OK now). I've also added global endpoints:

  • /all/show/route
  • /all/show/bgp
  • /all/show/evpn

If any pod will be queried with those it will pass those requests to all the network operator pods and will return response in form of:

"hostname1":
{json response}

"hostname2":
{json response}

I don't really have setup to fully test this using frr, but I'll try to check if this works when queried using a service, and I'll also try to add some unit tests.

@chdxD1
Copy link
Member Author

chdxD1 commented Mar 12, 2024

@p-strusiewiczsurmacki-mobica I've commented on the MR

  1. Probably it is better to use services for discovery
  2. It would be nice to get JSON for the global endpoints as well (see my idea in MR)

I'll try it out soon

@p-strusiewiczsurmacki-mobica
Copy link
Contributor

@chdxD1 - services are now used for discovery. See my comment in the PR for more details.
JSON output should be handled as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants