make cache size configurable

This commit is contained in:
mqliang
2016-02-24 20:19:30 +08:00
parent d9a35a25d7
commit e44e71ca87
14 changed files with 846 additions and 751 deletions

View File

@@ -94,7 +94,7 @@ type ReplicationManager struct {
}
// NewReplicationManager creates a new ReplicationManager.
func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, burstReplicas int) *ReplicationManager {
func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, burstReplicas int, lookupCacheSize int) *ReplicationManager {
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(glog.Infof)
eventBroadcaster.StartRecordingToSink(&unversionedcore.EventSinkImpl{kubeClient.Core().Events("")})
@@ -190,7 +190,7 @@ func NewReplicationManager(kubeClient clientset.Interface, resyncPeriod controll
rm.syncHandler = rm.syncReplicationController
rm.podStoreSynced = rm.podController.HasSynced
rm.lookupCache = controller.NewMatchingCache(controller.DefaultCacheEntries)
rm.lookupCache = controller.NewMatchingCache(lookupCacheSize)
return rm
}