mirror of https://github.com/k3s-io/k3s
Add debug info: scheduler extenders's score and its name for each pod
parent
16d0992534
commit
9fc369dd0d
|
@ -26,6 +26,9 @@ import (
|
|||
// decisions made by Kubernetes. This is typically needed for resources not directly
|
||||
// managed by Kubernetes.
|
||||
type SchedulerExtender interface {
|
||||
// Name returns a unique name that identifies the extender.
|
||||
Name() string
|
||||
|
||||
// Filter based on extender-implemented predicate functions. The filtered list is
|
||||
// expected to be a subset of the supplied list. failedNodesMap optionally contains
|
||||
// the list of failed nodes and failure reasons.
|
||||
|
|
|
@ -107,6 +107,11 @@ func NewHTTPExtender(config *schedulerapi.ExtenderConfig) (algorithm.SchedulerEx
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Name returns extenderURL to identifies the extender.
|
||||
func (h *HTTPExtender) Name() string {
|
||||
return h.extenderURL
|
||||
}
|
||||
|
||||
// IsIgnorable returns true indicates scheduling should not fail when this extender
|
||||
// is unavailable
|
||||
func (h *HTTPExtender) IsIgnorable() bool {
|
||||
|
|
|
@ -120,6 +120,10 @@ type FakeExtender struct {
|
|||
cachedNodeNameToInfo map[string]*schedulercache.NodeInfo
|
||||
}
|
||||
|
||||
func (f *FakeExtender) Name() string {
|
||||
return "FakeExtender"
|
||||
}
|
||||
|
||||
func (f *FakeExtender) IsIgnorable() bool {
|
||||
return f.ignorable
|
||||
}
|
||||
|
|
|
@ -692,7 +692,7 @@ func PrioritizeNodes(
|
|||
}
|
||||
if glog.V(10) {
|
||||
for _, hostPriority := range results[index] {
|
||||
glog.Infof("%v -> %v: %v, Score: (%d)", pod.Name, hostPriority.Host, config.Name, hostPriority.Score)
|
||||
glog.Infof("%v -> %v: %v, Score: (%d)", util.GetPodFullName(pod), hostPriority.Host, config.Name, hostPriority.Score)
|
||||
}
|
||||
}
|
||||
}(i, priorityConfig)
|
||||
|
@ -730,6 +730,9 @@ func PrioritizeNodes(
|
|||
mu.Lock()
|
||||
for i := range *prioritizedList {
|
||||
host, score := (*prioritizedList)[i].Host, (*prioritizedList)[i].Score
|
||||
if glog.V(10) {
|
||||
glog.Infof("%v -> %v: %v, Score: (%d)", util.GetPodFullName(pod), host, ext.Name(), score)
|
||||
}
|
||||
combinedScores[host] += score * weight
|
||||
}
|
||||
mu.Unlock()
|
||||
|
|
|
@ -532,6 +532,10 @@ type fakeExtender struct {
|
|||
ignorable bool
|
||||
}
|
||||
|
||||
func (f *fakeExtender) Name() string {
|
||||
return "fakeExtender"
|
||||
}
|
||||
|
||||
func (f *fakeExtender) IsIgnorable() bool {
|
||||
return f.ignorable
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue