|
@@ -53,6 +53,8 @@ var (
|
|
|
grpcProxyDNSCluster string
|
|
grpcProxyDNSCluster string
|
|
|
grpcProxyInsecureDiscovery bool
|
|
grpcProxyInsecureDiscovery bool
|
|
|
grpcProxyDataDir string
|
|
grpcProxyDataDir string
|
|
|
|
|
+ grpcMaxCallSendMsgSize int
|
|
|
|
|
+ grpcMaxCallRecvMsgSize int
|
|
|
|
|
|
|
|
// tls for connecting to etcd
|
|
// tls for connecting to etcd
|
|
|
|
|
|
|
@@ -115,6 +117,8 @@ func newGRPCProxyStartCommand() *cobra.Command {
|
|
|
cmd.Flags().StringVar(&grpcProxyNamespace, "namespace", "", "string to prefix to all keys for namespacing requests")
|
|
cmd.Flags().StringVar(&grpcProxyNamespace, "namespace", "", "string to prefix to all keys for namespacing requests")
|
|
|
cmd.Flags().BoolVar(&grpcProxyEnablePprof, "enable-pprof", false, `Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"`)
|
|
cmd.Flags().BoolVar(&grpcProxyEnablePprof, "enable-pprof", false, `Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"`)
|
|
|
cmd.Flags().StringVar(&grpcProxyDataDir, "data-dir", "default.proxy", "Data directory for persistent data")
|
|
cmd.Flags().StringVar(&grpcProxyDataDir, "data-dir", "default.proxy", "Data directory for persistent data")
|
|
|
|
|
+ cmd.Flags().IntVar(&grpcMaxCallSendMsgSize, "max-send-bytes", 1.5*1024*1024, "message send limits in bytes (default value is 1.5 MiB)")
|
|
|
|
|
+ cmd.Flags().IntVar(&grpcMaxCallRecvMsgSize, "max-recv-bytes", math.MaxInt32, "message receive limits in bytes (default value is math.MaxInt32)")
|
|
|
|
|
|
|
|
// client TLS for connecting to server
|
|
// client TLS for connecting to server
|
|
|
cmd.Flags().StringVar(&grpcProxyCert, "cert", "", "identify secure connections with etcd servers using this TLS certificate file")
|
|
cmd.Flags().StringVar(&grpcProxyCert, "cert", "", "identify secure connections with etcd servers using this TLS certificate file")
|
|
@@ -241,6 +245,14 @@ func newClientCfg(eps []string) (*clientv3.Config, error) {
|
|
|
Endpoints: eps,
|
|
Endpoints: eps,
|
|
|
DialTimeout: 5 * time.Second,
|
|
DialTimeout: 5 * time.Second,
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if grpcMaxCallSendMsgSize > 0 {
|
|
|
|
|
+ cfg.MaxCallSendMsgSize = grpcMaxCallSendMsgSize
|
|
|
|
|
+ }
|
|
|
|
|
+ if grpcMaxCallRecvMsgSize > 0 {
|
|
|
|
|
+ cfg.MaxCallRecvMsgSize = grpcMaxCallRecvMsgSize
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
tls := newTLS(grpcProxyCA, grpcProxyCert, grpcProxyKey)
|
|
tls := newTLS(grpcProxyCA, grpcProxyCert, grpcProxyKey)
|
|
|
if tls == nil && grpcProxyInsecureSkipTLSVerify {
|
|
if tls == nil && grpcProxyInsecureSkipTLSVerify {
|
|
|
tls = &transport.TLSInfo{}
|
|
tls = &transport.TLSInfo{}
|