Skip to content

Commit 38ea496

Browse files
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.
1 parent 44530e9 commit 38ea496

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cmd/server/kubernetes/master/master_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func BuildKubeAPIserverOptions(masterConfig configapi.MasterConfig) (*kapiserver
150150
server.Etcd.StorageConfig.KeyFile = masterConfig.EtcdClientInfo.ClientCert.KeyFile
151151
server.Etcd.StorageConfig.CertFile = masterConfig.EtcdClientInfo.ClientCert.CertFile
152152
server.Etcd.StorageConfig.CAFile = masterConfig.EtcdClientInfo.CA
153-
server.Etcd.DefaultWatchCacheSize = DefaultWatchCacheSize
153+
server.Etcd.DefaultWatchCacheSize = 0
154154

155155
server.GenericServerRunOptions.CorsAllowedOriginList = masterConfig.CORSAllowedOrigins
156156
server.GenericServerRunOptions.MaxRequestsInFlight = masterConfig.ServingInfo.MaxRequestsInFlight

0 commit comments

Comments
 (0)