Skip to content

Commit f5fbc4e

Browse files
committed
fix(grpc): disable grpc service discovery to prevent dns flooding
longhorn-12521 Signed-off-by: Raphanus Lo <yunchang.lo@suse.com>
1 parent 749a692 commit f5fbc4e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/util/grpcutil.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ func Connect(endpoint string, tlsConfig *tls.Config, dialOptions ...grpc.DialOpt
5252
// Code lifted from https://github.com/kubernetes-csi/csi-test/commit/6b8830bf5959a1c51c6e98fe514b22818b51eeeb
5353
dialOptions = append(dialOptions, grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 30 * time.Second, PermitWithoutStream: true}))
5454

55+
// Disable gRPC service config discovery to prevent DNS flooding in Kubernetes
56+
dialOptions = append(dialOptions, grpc.WithDisableServiceConfig())
57+
5558
return grpc.NewClient(address, dialOptions...)
5659
}
5760

0 commit comments

Comments
 (0)