use cache size to signal undecorated storage

This commit is contained in:
Yassine TIJANI
2019-02-20 22:15:24 +01:00
parent ee50d4784d
commit 8261d3d9a6
4 changed files with 4 additions and 6 deletions

View File

@@ -39,6 +39,7 @@ func NewHeuristicWatchCacheSizes(expectedRAMCapacityMB int) map[schema.GroupReso
watchCacheSizes[schema.GroupResource{Resource: "nodes"}] = maxInt(5*clusterSize, 1000)
watchCacheSizes[schema.GroupResource{Resource: "pods"}] = maxInt(50*clusterSize, 1000)
watchCacheSizes[schema.GroupResource{Resource: "services"}] = maxInt(5*clusterSize, 1000)
watchCacheSizes[schema.GroupResource{Resource: "events"}] = 0
watchCacheSizes[schema.GroupResource{Resource: "apiservices", Group: "apiregistration.k8s.io"}] = maxInt(5*clusterSize, 1000)
return watchCacheSizes
}

View File

@@ -40,10 +40,6 @@ func NewREST(optsGetter generic.RESTOptionsGetter, ttl uint64) *REST {
panic(err) // TODO: Propagate error up
}
// We explicitly do NOT do any decoration here - switching on Cacher
// for events will lead to too high memory consumption.
opts.Decorator = generic.UndecoratedStorage // TODO use watchCacheSize=-1 to signal UndecoratedStorage
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &api.Event{} },
NewListFunc: func() runtime.Object { return &api.EventList{} },