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

The routing announcement function of service subnet summary is added to reduce the number of routes of neighbor network devices and support large BGP network. #1049

Conversation

cloudnativer
Copy link
Contributor

@cloudnativer cloudnativer commented Mar 22, 2021

This is a code update based on #920 . Because #920's code is based on kube-router v0.3, and there is a big conflict between the new version of kube-router v1.1.1 and #920's code. Based on the new version of kube-router v1.1.1, I rewrote the advertise-service-cluster-ip-range function.

@cloudnativer
Copy link
Contributor Author

Each kubernetes cluster in our production environment has 4000 nodes, and the whole network is interconnected by BGP, which has been running stably for more than two year. There are many problems with kube-router in the large kubernetes cluster, and we have done a lot of optimization, so I want to contribute some information to the community.I have contributed an enhanced function in the large kubernetes cluster network to kube-router, as well as several practical documents about the large kubernetes cluster network.

Added the advertise-service-cluster-ip-range flag parameter for optimizing the number of routes.
I added the advertise-service-cluster-ip-range flag parameter to kube-router. When you set the parameters of -advertise-cluster-IP=true and -advertise-service-cluster-ip-range=you_service_ip_cidr at the same time, the kubernetes node will only announce the aggregate cluster route you specified to the on-line router device.
The advantage is that when your kubernetes cluster is large and you need to announce cluster-ip routing, using this feature can reduce the number of service routing by 90%. This greatly reduces the cost of routers and can cope with larger network concurrent traffic.

Documents for optimization of large kubernetes cluster network are compiled. Please check #944 for details.
In order for your architecture to support a larger network, you need to do the following two things:
(1) Set the parameter --enable-ibgp=false, do not let kubernetes node directly establish BGP neighbors with each other. Let your kubernetes node only build BGP neighbors with the on-line router device.(See large-networks02 documentation).
(2) You'd better turn on the BGP ECMP function of the kubernetes node on-line router device. The effect of this method is that when the user's access traffic enters the router device, it is first balanced to the kubernetes node of the back end through ECMP load balancing, and then to the final pod through IPVS load balancing. When devices, links and nodes in the network are down, traffic can be automatically switched to other healthy devices, links and nodes. In this way, the availability, high performance and scalability of the network are realized.(See large-networks04 documentation).
(3) You need to set both --advertise-cluster-IP=true and --advertise-service-cluster-ip-range=subnet parameters.Let kubernetes node only notify k8s service aggregate routes to the upstream routers, reducing the service routing entries of the upstream routers.(See large-networks03 documentation).

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

Successfully merging this pull request may close these issues.

1 participant