mirror of
https://github.com/nclabteam/THPA.git
synced 2025-03-09 15:39:59 +00:00
- Initializing THPA repo
This commit is contained in:
commit
b8bdef8213
26 changed files with 2570 additions and 0 deletions
15
scheduler-extender/k8s-scheduler-extender/prioritize.go
Normal file
15
scheduler-extender/k8s-scheduler-extender/prioritize.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/extender/v1"
|
||||
)
|
||||
|
||||
type Prioritize struct {
|
||||
Name string
|
||||
Func func(pod v1.Pod, nodes []v1.Node) (*schedulerapi.HostPriorityList, error)
|
||||
}
|
||||
|
||||
func (p Prioritize) Handler(args schedulerapi.ExtenderArgs) (*schedulerapi.HostPriorityList, error) {
|
||||
return p.Func(*args.Pod, args.Nodes.Items)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue