From 38ea496efae3a38d103dd71b25dae333bf200e21 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sat, 16 Sep 2017 23:47:41 -0400 Subject: [PATCH] Disable the watch cache for most resources by default Any resource named by the heuristics gets a watch cache by default. Admins can restore the previous behavior by setting `--default-watch-cache-size` to a positive integer. This reduces the amount of total memory allocated on large cluster significantly at minor cost in CPU on the etcd process and an increase in network bandwidth to etcd. --- pkg/cmd/server/kubernetes/master/master_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/server/kubernetes/master/master_config.go b/pkg/cmd/server/kubernetes/master/master_config.go index 06cf334b554f..e42843028d9a 100644 --- a/pkg/cmd/server/kubernetes/master/master_config.go +++ b/pkg/cmd/server/kubernetes/master/master_config.go @@ -150,7 +150,7 @@ func BuildKubeAPIserverOptions(masterConfig configapi.MasterConfig) (*kapiserver server.Etcd.StorageConfig.KeyFile = masterConfig.EtcdClientInfo.ClientCert.KeyFile server.Etcd.StorageConfig.CertFile = masterConfig.EtcdClientInfo.ClientCert.CertFile server.Etcd.StorageConfig.CAFile = masterConfig.EtcdClientInfo.CA - server.Etcd.DefaultWatchCacheSize = DefaultWatchCacheSize + server.Etcd.DefaultWatchCacheSize = 0 server.GenericServerRunOptions.CorsAllowedOriginList = masterConfig.CORSAllowedOrigins server.GenericServerRunOptions.MaxRequestsInFlight = masterConfig.ServingInfo.MaxRequestsInFlight