Skip to content

Commit d8cac91

Browse files
committed
feat(options): allow disabling GoBGP grpc port
1 parent de3e218 commit d8cac91

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/user-guide.md

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

pkg/controllers/routing/network_routes_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ func (nrc *NetworkRoutingController) startBgpServer(grpcServer bool) error {
10151015
}
10161016
}
10171017

1018-
if grpcServer {
1018+
if grpcServer && nrc.goBGPAdminPort != 0 {
10191019
nrc.bgpServer = gobgp.NewBgpServer(
10201020
gobgp.GrpcListenAddress(net.JoinHostPort(nrc.krNode.GetPrimaryNodeIP().String(),
10211021
strconv.FormatUint(uint64(nrc.goBGPAdminPort), 10)) + "," +

pkg/options/options.go

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

0 commit comments

Comments
 (0)