diff --git a/docs/user-guide.md b/docs/user-guide.md index b48dad69..25f3fadd 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -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. diff --git a/pkg/controllers/routing/network_routes_controller.go b/pkg/controllers/routing/network_routes_controller.go index babc5838..7610fb10 100644 --- a/pkg/controllers/routing/network_routes_controller.go +++ b/pkg/controllers/routing/network_routes_controller.go @@ -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)) + "," + diff --git a/pkg/options/options.go b/pkg/options/options.go index e193845d..1215af87 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -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.")