-
Notifications
You must be signed in to change notification settings - Fork 42.1k
Description
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
maybe a bug or a point we can improve
Kubernetes version (use kubectl version):
k8s1.3.5. I think it still exist in 1.6
What happened:
when restart kube-scheduler component, kube-scheduler schedules pod to node which has not enough resources. So this pod is set Falied by kubelet.
What you expected to happen:
we don't want to schedule pod to node which has not enough resources, and i think we had better deal with this question in kube-scheduler instead of in kubelet(Predicate Again).
How to reproduce it (as minimally and precisely as possible):
Firstly, restart kube-scheduler.
A Pod that needs scheduling. Newly created or Created before scheduler shutdown.
And scheduledPod cache has not been completely synced. So some nodes may be thought has enough resources. (if scheduledPod cache is synced completely, these nodes may have not enough resources for new pod)
Now schduler is scheduling this pod. Scheduler may schedule pod to nodes which have not enough resources. However scheduler thinks target node has enough resources.
When corresponding kubelet watchs this schedule event, it re-runs Predicate Func and finds that this node doesn't have enough resources.
Anything else we need to know:
I think we shoud add HasSynced func for ScheduledPod cache in kube-scheduler. Until ScheduledPod cache syncs completely, start the work of scheduling pod.