mirror of
https://github.com/outbackdingo/kubernetes.git
synced 2026-01-28 02:19:27 +00:00
Finalizers do not work as expected when an informer with a field selector is used. Any time a pod changing its state gets excluded by the field selector a synthetic delete event is issues even though the pod with a finalizer set is still present. Thus, making the scheduler schedule the high and medium priority pods before any of the low priority pod finalizers is removed. Instead, rely on preStop hook and TerminationGracePeriodSeconds to keep all low priority pods long enough included by the field selector so all high priority pods can set their .status.nominatedNodeName field. Also, update the check for how many medium priority pods are expected to be scheduled. Each node can accept 10 pods of the given extended resources. Given there's 5 high priority created per node, there's always 5 times number of nodes spots left for the medium priority pods.