atlassian / escalator

Escalator is a batch or job optimized horizontal autoscaler for Kubernetes
Apache License 2.0
662 stars 59 forks source link

Remove MetaNamespaceIndexFunc Indexer from watch cache #178

Closed Jacobious52 closed 4 years ago

Jacobious52 commented 5 years ago

The watch cache setup in cache.go uses a MetaNamespaceIndexFunc indexer. As escalator does not list by namespace, only at a cluster level, it is unnecessary. Additionally this introduces a memory leak from client-go with high churn namespaces until kubernetes/84970 is released and escalator uses a client-go version with the patch.

cache.Indexers{
    cache.NamespaceIndex: cache.MetaNamespaceIndexFunc,
},