mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Emit event when scheduling daemon fails
Restoring the code which was removed in 528bf7a
. When there are no sufficient
resources on node or there is a conflicting host port event is emited.
It helps with debugging.
Fixes #31369
This commit is contained in:
parent
33ebe1f18b
commit
0d7371fdfe
@ -687,6 +687,14 @@ func (dsc *DaemonSetsController) nodeShouldRunDaemonPod(node *api.Node, ds *exte
|
|||||||
}
|
}
|
||||||
for _, r := range reasons {
|
for _, r := range reasons {
|
||||||
glog.V(4).Infof("GeneralPredicates failed on ds '%s/%s' for reason: %v", ds.ObjectMeta.Namespace, ds.ObjectMeta.Name, r.GetReason())
|
glog.V(4).Infof("GeneralPredicates failed on ds '%s/%s' for reason: %v", ds.ObjectMeta.Namespace, ds.ObjectMeta.Name, r.GetReason())
|
||||||
|
switch reason := r.(type) {
|
||||||
|
case *predicates.InsufficientResourceError:
|
||||||
|
dsc.eventRecorder.Eventf(ds, api.EventTypeNormal, "FailedPlacement", "failed to place pod on %q: %s", node.ObjectMeta.Name, reason.Error())
|
||||||
|
case *predicates.PredicateFailureError:
|
||||||
|
if reason == predicates.ErrPodNotFitsHostPorts {
|
||||||
|
dsc.eventRecorder.Eventf(ds, api.EventTypeNormal, "FailedPlacement", "failed to place pod on %q: host port conflict", node.ObjectMeta.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return fit
|
return fit
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user