feat(options): allow disabling GoBGP grpc port

This commit is contained in:
Aaron U'Ren 2025-03-30 19:30:31 -05:00 committed by Aaron U'Ren
parent de3e2186a1
commit d8cac914ab
3 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ Usage of kube-router:
--enable-pod-egress SNAT traffic from Pods to destinations outside the cluster. (default true)
--enable-pprof Enables pprof for debugging performance and memory leak issues.
--excluded-cidrs strings Excluded CIDRs are used to exclude IPVS rules from deletion.
--gobgp-admin-port uint16 Port to connect to GoBGP for administrative purposes. (default 50051)
--gobgp-admin-port uint16 Port to connect to GoBGP for administrative purposes. Setting this to 0 will disable the GoBGP gRPC server. (default 50051)
--hairpin-mode Add iptables rules for every Service Endpoint to support hairpin traffic.
--health-port uint16 Health check port, 0 = Disabled (default 20244)
-h, --help Print usage information.

View File

@ -1015,7 +1015,7 @@ func (nrc *NetworkRoutingController) startBgpServer(grpcServer bool) error {
}
}
if grpcServer {
if grpcServer && nrc.goBGPAdminPort != 0 {
nrc.bgpServer = gobgp.NewBgpServer(
gobgp.GrpcListenAddress(net.JoinHostPort(nrc.krNode.GetPrimaryNodeIP().String(),
strconv.FormatUint(uint64(nrc.goBGPAdminPort), 10)) + "," +

View File

@ -167,7 +167,7 @@ func (s *KubeRouterConfig) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&s.GlobalHairpinMode, "hairpin-mode", false,
"Add iptables rules for every Service Endpoint to support hairpin traffic.")
fs.Uint16Var(&s.GoBGPAdminPort, "gobgp-admin-port", defaultGoBGPAdminPort,
"Port to connect to GoBGP for administrative purposes.")
"Port to connect to GoBGP for administrative purposes. Setting this to 0 will disable the GoBGP gRPC server.")
fs.Uint16Var(&s.HealthPort, "health-port", defaultHealthCheckPort, "Health check port, 0 = Disabled")
fs.BoolVarP(&s.HelpRequested, "help", "h", false,
"Print usage information.")