cloudnativelabs / kube-router

Kube-router, a turnkey solution for Kubernetes networking.
https://kube-router.io
Apache License 2.0
2.31k stars 468 forks source link

RouteReflecor client broken in v0.2.0-beta #451

Closed eugenepaniot closed 6 years ago

eugenepaniot commented 6 years ago

How to reproduce

  1. Annotate nodes 1.1 Master node / RR Server
    # kubectl describe   node/ams04-e01-kbs01
    ...
    Annotations:        kube-router.io/node.asn=65430
                    kube-router.io/rr.client=65430
                    kube-router.io/rr.server=65430
    ...
    Addresses:
    InternalIP:  10.56.21.73
    Hostname:    ams04-e01-kbs01

1.2 Slave node / RR Client

# kubectl describe   node/ams04-e01-kbs11
...
Annotations:        kube-router.io/node.asn=65430
                    kube-router.io/rr.client=65430
...
Addresses:
  InternalIP:  10.56.21.75
  Hostname:    ams04-e01-kbs11
...
  1. Execute 0.2.0 kube-router

kube-router --bgp-graceful-restart --nodes-full-mesh=true --master http://ams04-e01-kbs01:8080 --kubeconfig /etc/kubernetes/kubeconfigs/kube-proxy.kubeconfig --iptables-sync-period 2s --ipvs-sync-period 2s --routes-sync-period 2s --run-service-proxy=false --hairpin-mode --enable-pprof --metrics-port 1180 --v=2 --peer-router-asns 65430,65430 --peer-router-ips 10.56.20.2,10.56.20.3 --peer-router-multihop-ttl 255 --enable-ibgp=true --cluster-asn 65430

Wrong behaviour

In log:

...
E0525 11:56:36.955931 3382294 bgp_peers.go:140] Failed to add node 10.56.21.75 as peer due to route-reflector-cluster-id should be specified in IPv4 address format
...

Neighbor haven't been added to configuration, as error.

Expected behaviour

  1. In 0.1.0 kube-router
    ...
    INFO[0001] Add a peer configuration for:10.56.21.75      Topic=Peer
    ...
  2. Neighbor added to configuration as rr client
# ./gobgp -d n 10.56.21.75
BGP neighbor is 10.56.21.75, remote AS 65430, route-reflector-client
  BGP version 4, remote router ID 10.56.21.75
  BGP state = established, up for 00:00:08
  BGP OutQ = 0, Flops = 0
  Hold time is 90, keepalive interval is 30 seconds
  Configured hold time is 90, keepalive interval is 30 seconds

  Neighbor capabilities:
    multiprotocol:
        ipv4-unicast:   advertised and received
    route-refresh:  advertised and received
    graceful-restart:   advertised and received
        Local: restart time 90 sec, restart flag set
        ipv4-unicast, forward flag set
        Remote: restart time 90 sec
        ipv4-unicast
    4-octet-as: advertised and received
  Message statistics:
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                0          6
    Keepalives:             1          1
    Route Refresh:          0          0
    Discarded:              0          0
    Total:                  2          8
  Route statistics:
    Advertised:             2
    Received:               1
    Accepted:               1
murali-reddy commented 6 years ago

thanks @eugenepaniot for reprot. So in 0.1.0 its working fine but it's a regression in the latest HEAD?

eugenepaniot commented 6 years ago

@murali-reddy yes, 0.1.0 works fine. I've tried to migrate to latest version, but unsuccessful -(

ut0mt8 commented 6 years ago

I will look at the change if I see something wrong

murali-reddy commented 6 years ago

@eugenepaniot @ut0mt8 this is enforcement added recently in GoBGP

https://github.com/osrg/gobgp/blob/master/config/default.go#L245

GoBGP version used in 0.1.0 did not had this enforcement.

ut0mt8 commented 6 years ago

Afaik using @IP for cluster id is just a convention. The RFC state 4 bytes long number and most implementation accept both form. Anyway the better is to update the example in the doc.

murali-reddy commented 6 years ago

I opened https://github.com/osrg/gobgp/issues/1719 to know the rationale.

murali-reddy commented 6 years ago

Ok patch is on the way in GoBGP.

murali-reddy commented 6 years ago

Its fixed in upstream, we need to vendor latest master or wait for GoBGP new release.

ghost commented 6 years ago

Any updates on that?

ut0mt8 commented 6 years ago

I'm assuming this was fixed ? not the case ?

murali-reddy commented 6 years ago

Unfortunately this issue missed attention. Its not fixed (basically need to use latest GoBGP) yet from kube-router side.