Bump grpc max message size for docker service

This commit is contained in:
Davanum Srinivas 2018-05-19 16:52:00 -04:00
parent e04ccf5526
commit eb6bd67446
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

View File

@ -28,6 +28,10 @@ import (
"k8s.io/kubernetes/pkg/util/interrupt" "k8s.io/kubernetes/pkg/util/interrupt"
) )
// maxMsgSize use 8MB as the default message size limit.
// grpc library default is 4MB
const maxMsgSize = 1024 * 1024 * 8
// DockerServer is the grpc server of dockershim. // DockerServer is the grpc server of dockershim.
type DockerServer struct { type DockerServer struct {
// endpoint is the endpoint to serve on. // endpoint is the endpoint to serve on.
@ -60,7 +64,10 @@ func (s *DockerServer) Start() error {
return fmt.Errorf("failed to listen on %q: %v", s.endpoint, err) return fmt.Errorf("failed to listen on %q: %v", s.endpoint, err)
} }
// Create the grpc server and register runtime and image services. // Create the grpc server and register runtime and image services.
s.server = grpc.NewServer() s.server = grpc.NewServer(
grpc.MaxRecvMsgSize(maxMsgSize),
grpc.MaxSendMsgSize(maxMsgSize),
)
runtimeapi.RegisterRuntimeServiceServer(s.server, s.service) runtimeapi.RegisterRuntimeServiceServer(s.server, s.service)
runtimeapi.RegisterImageServiceServer(s.server, s.service) runtimeapi.RegisterImageServiceServer(s.server, s.service)
go func() { go func() {