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>
This commit is contained in:
		@@ -30,6 +30,7 @@ import (
 | 
				
			|||||||
	"go.etcd.io/etcd/client/pkg/v3/transport"
 | 
						"go.etcd.io/etcd/client/pkg/v3/transport"
 | 
				
			||||||
	clientv3 "go.etcd.io/etcd/client/v3"
 | 
						clientv3 "go.etcd.io/etcd/client/v3"
 | 
				
			||||||
	"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
 | 
						"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
 | 
				
			||||||
 | 
						"go.uber.org/zap"
 | 
				
			||||||
	"google.golang.org/grpc"
 | 
						"google.golang.org/grpc"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/runtime"
 | 
						"k8s.io/apimachinery/pkg/runtime"
 | 
				
			||||||
@@ -223,6 +224,10 @@ var newETCD3Client = func(c storagebackend.TransportConfig) (*clientv3.Client, e
 | 
				
			|||||||
		DialOptions:          dialOptions,
 | 
							DialOptions:          dialOptions,
 | 
				
			||||||
		Endpoints:            c.ServerList,
 | 
							Endpoints:            c.ServerList,
 | 
				
			||||||
		TLS:                  tlsConfig,
 | 
							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)
 | 
						return clientv3.New(cfg)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user