Scheduler volumebinding plugin - handle Lost PVC as
UnschedulableAndUnresolvable This change adds an additional check in the volumebinding scheduler plugin to handle PVC with phase ClaimLost which will allow the scheduler to return UnschedulableAndUnresolvable during the PreFilter stage and skip the rest of the node evaluation since the PVC is bound to a PV that does not exist. Without this change, the FailedScheduling error message would look like: 0/10 nodes are available: 2 node(s) had taint {node/test: true}, that the pod didn't tolerate, 6 node(s) had taint {node/unhealthy: true}, that the pod didn't tolerate, 2 pvc(s) bound to non-existent pv(s) Which is still evaluating every single node to determine that the pod cannot be scheduled because the PVC is bound to a non-existent PV With this change, the FailedScheduling error message would look like: 0/10 nodes are available: 1 persistentvolumeclaim "foo" bound to non-existent persistentvolume "bar" Signed-off By: Yibo Zhuang <yibzhuang@gmail.com>
This commit is contained in:
@@ -135,6 +135,13 @@ func (pvcb pvcBuilder) withRequestStorage(request resource.Quantity) pvcBuilder
|
||||
return pvcb
|
||||
}
|
||||
|
||||
func (pvcb pvcBuilder) withPhase(phase v1.PersistentVolumeClaimPhase) pvcBuilder {
|
||||
pvcb.PersistentVolumeClaim.Status = v1.PersistentVolumeClaimStatus{
|
||||
Phase: phase,
|
||||
}
|
||||
return pvcb
|
||||
}
|
||||
|
||||
type podBuilder struct {
|
||||
*v1.Pod
|
||||
}
|
||||
|
Reference in New Issue
Block a user