Move to use testing PodWrapper where applicable to
reduce duplicating pod creation code and shorten
number of lines.
Adding additional wrapper functions in PodWrapper
to ensure it covers all pod spec under tests.
Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
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>
When the client misses a delete event from the watcher, it will use the last state of the pod in the informer cache to produce a delete event. At that point, it's not clear if the pod was in the queues or the cache, so we should issue a deletion in both.
The pod could be assumed, so deletion of assumed pods from the cache should work.
Change-Id: I11ce9785de603924fc121fe2fa6ed5cb1e16922f
kubernetes#60525 introduced
Balanced attached node volumes feature gate to include volume
count for prioritizing nodes. The reason for introducing this
flag was its usefulness in Red Hat OpenShift Online environment
which is not being used any more. So, removing the flag
as it helps in maintainability of the scheduler code base
as mentioned at kubernetes#101489 (comment)
* Rename const for topology.../zone
* Rename const for topology.../region
* Rename const for failure-domain.../zone
* Rename const for failure-domain.../region
* Restore old names for compat
This commit transforms the next() function of the scheduler node
tree into a listNodes() function that directly returns a list of
nodes, going through the zones in a round-robin fashion. This
removes the flawed logic of the next() function.
The apiserver is expected to send pod deletion events that might arrive at a different time. However, sometimes a node could be recreated without its pods being deleted.
Partial revert of https://github.com/kubernetes/kubernetes/pull/86964
Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: I51f683e5f05689b711c81ebff34e7118b5337571
When nodes are added in multiple zones at once, the nodeTree next
function does not return a correct list of nodes but repeats some
This commit resets the index before starting to call next() to
prevent this issue
Special thanks to igraecao for the help in finding the bug
Co-authored-by: igraecao <matvej.yolli@outlook.com>