This change creates a StorageInfoLister interface
and have it under scheduler SharedLister.
The initial StorageInfoLister interface has a
IsPVCUsedByPods which returns true/false depending on
whether the PVC (keyed by namespace/name) has at least
one scheduled pod using it.
In snapshot real implementation, add a usedPVCSet
key by PVC namespace/name which contains all PVCs
that have at least one scheduled pod using it.
During snapshot update, populate this set based on
whether the PVCRefCounts map for node(s) have been
updated since last snapshot.
Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
This is a performance optimization that reduces the overhead of inter-pod affinity PreFilter calculaitons. Basically
eliminates that overhead when no pods in the cluster use required pod anti-affinity. This offered 20% improvement on 5k clusters for preferred anti-affinity benchmarks.