Disable the etcd3 client logger

This logger is responsible for 20% of the API server's memory usage when
many CRDs are installed. See the below issue for more context.

https://github.com/kubernetes/kubernetes/issues/111476

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: c1c18295893282ae32e7be0d09f607680241712f
This commit is contained in:
Nic Cope 2022-07-27 14:44:49 -07:00 committed by Kubernetes Publisher
parent 608cee4644
commit a2f2f0453d
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import (
"go.etcd.io/etcd/client/pkg/v3/transport"
clientv3 "go.etcd.io/etcd/client/v3"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.uber.org/zap"
"google.golang.org/grpc"
"k8s.io/apimachinery/pkg/runtime"
@ -179,6 +180,10 @@ func newETCD3Client(c storagebackend.TransportConfig) (*clientv3.Client, error)
DialOptions: dialOptions,
Endpoints: c.ServerList,
TLS: tlsConfig,
// This logger uses a significant amount of memory when many CRDs (i.e.
// 1,000+) are added to the API server, so we disable it.
Logger: zap.NewNop(),
}
return clientv3.New(cfg)