Documentation
¶
Index ¶
- func BuildBestEffortPod(namespace, name, nodeName string, p corev1.PodPhase, groupName string, ...) *corev1.Pod
- func BuildDynamicPVC(namespace, name string, req corev1.ResourceList) (*corev1.PersistentVolumeClaim, *corev1.PersistentVolume, ...)
- func BuildNode(name string, alloc corev1.ResourceList, labels map[string]string) *corev1.Node
- func BuildPod(namespace, name, nodeName string, p corev1.PodPhase, req corev1.ResourceList, ...) *corev1.Pod
- func BuildPodWithPVC(namespace, name, nodeName string, p corev1.PodPhase, req corev1.ResourceList, ...) *corev1.Pod
- func BuildPodWithPriority(namespace, name, nodeName string, p corev1.PodPhase, req corev1.ResourceList, ...) *corev1.Pod
- func BuildResourceList(cpu string, memory string) corev1.ResourceList
- func BuildResourceListWithGPU(cpu string, memory string, GPU string) corev1.ResourceList
- func CalculateNumOfFeasibleNodesToFind(numAllNodes int32) (numNodes int32)
- func GetMinInt(values ...int) int
- func GetNodeList(nodes map[string]*apis.NodeInfo, nodeList []string) []*apis.NodeInfo
- func PrioritizeNodes(task *apis.TaskInfo, nodes []*apis.NodeInfo, batchFn apis.BatchNodeOrderFn, ...) map[float64][]*apis.NodeInfo
- func SelectBestNode(nodeScores map[float64][]*apis.NodeInfo) *apis.NodeInfo
- func SortNodes(nodeScores map[float64][]*apis.NodeInfo) []*apis.NodeInfo
- func ValidateVictims(preemptor *apis.TaskInfo, node *apis.NodeInfo, victims []*apis.TaskInfo) error
- type FakeBinder
- type FakeEvictor
- type FakeStatusUpdater
- type FakeVolumeBinder
- func (fvb *FakeVolumeBinder) AllocateVolumes(task *apis.TaskInfo, hostname string, podVolumes *volumebinding.PodVolumes) error
- func (fvb *FakeVolumeBinder) BindVolumes(task *apis.TaskInfo, podVolumes *volumebinding.PodVolumes) error
- func (fvb *FakeVolumeBinder) GetPodVolumes(task *apis.TaskInfo, node *corev1.Node) (*volumebinding.PodVolumes, error)
- func (fvb *FakeVolumeBinder) RevertVolumes(task *apis.TaskInfo, podVolumes *volumebinding.PodVolumes)
- type PredicateHelper
- type PriorityQueue
- type ResourceReservation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBestEffortPod ¶
func BuildDynamicPVC ¶
func BuildDynamicPVC(namespace, name string, req corev1.ResourceList) (*corev1.PersistentVolumeClaim, *corev1.PersistentVolume, *storagev1.StorageClass)
func BuildPodWithPVC ¶
func BuildPodWithPriority ¶
func BuildResourceList ¶
func BuildResourceList(cpu string, memory string) corev1.ResourceList
func BuildResourceListWithGPU ¶
func BuildResourceListWithGPU(cpu string, memory string, GPU string) corev1.ResourceList
func CalculateNumOfFeasibleNodesToFind ¶
CalculateNumOfFeasibleNodesToFind returns the number of feasible nodes to find based on server options. Once found, the scheduler stops its search for more feasible nodes.
func GetNodeList ¶
GetNodeList returns the nodes denoted by nodeList from `nodes`.
func PrioritizeNodes ¶
func PrioritizeNodes(task *apis.TaskInfo, nodes []*apis.NodeInfo, batchFn apis.BatchNodeOrderFn, mapFn apis.NodeOrderMapFn, reduceFn apis.NodeOrderReduceFn) map[float64][]*apis.NodeInfo
PrioritizeNodes returns a map whose key is node's score and value are corresponding nodes.
func SelectBestNode ¶
SelectBestNode returns the best node whose score is the highest. It picks one node randomly if there are many nodes with same score.
Types ¶
type FakeBinder ¶
FakeBinder is used as fake binder
func (*FakeBinder) Bind ¶
func (fb *FakeBinder) Bind(kubeClient *kubernetes.Clientset, tasks []*apis.TaskInfo) ([]*apis.TaskInfo, error)
Bind binds each task to its allocated node.
type FakeEvictor ¶
type FakeEvictor struct {
sync.Mutex
Channel chan string
// contains filtered or unexported fields
}
FakeEvictor is used as fake evictor
func (*FakeEvictor) Evict ¶
func (fe *FakeEvictor) Evict(pod *corev1.Pod, reason string) error
Evict adds p to FakeEvictor.evicts.
func (*FakeEvictor) Evicts ¶
func (fe *FakeEvictor) Evicts() []string
type FakeStatusUpdater ¶
type FakeStatusUpdater struct {
}
FakeStatusUpdater is used for fake status update
func (*FakeStatusUpdater) UpdatePodCondition ¶
func (fsu *FakeStatusUpdater) UpdatePodCondition(pod *corev1.Pod, podCondition *corev1.PodCondition) (*corev1.Pod, error)
func (*FakeStatusUpdater) UpdatePodGroup ¶
type FakeVolumeBinder ¶
type FakeVolumeBinder struct {
Actions map[string][]string
// contains filtered or unexported fields
}
FakeVolumeBinder is used as fake volume binder
func NewFakeVolumeBinder ¶
func NewFakeVolumeBinder(kubeClient kubernetes.Interface) *FakeVolumeBinder
func (*FakeVolumeBinder) AllocateVolumes ¶
func (fvb *FakeVolumeBinder) AllocateVolumes(task *apis.TaskInfo, hostname string, podVolumes *volumebinding.PodVolumes) error
func (*FakeVolumeBinder) BindVolumes ¶
func (fvb *FakeVolumeBinder) BindVolumes(task *apis.TaskInfo, podVolumes *volumebinding.PodVolumes) error
func (*FakeVolumeBinder) GetPodVolumes ¶
func (fvb *FakeVolumeBinder) GetPodVolumes(task *apis.TaskInfo, node *corev1.Node) (*volumebinding.PodVolumes, error)
func (*FakeVolumeBinder) RevertVolumes ¶
func (fvb *FakeVolumeBinder) RevertVolumes(task *apis.TaskInfo, podVolumes *volumebinding.PodVolumes)
type PredicateHelper ¶
type PredicateHelper interface {
PredicateNodes(task *apis.TaskInfo, nodes []*apis.NodeInfo, fn apis.PredicateFn) ([]*apis.NodeInfo, *apis.FitErrors)
}
func NewPredicateHelper ¶
func NewPredicateHelper() PredicateHelper
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func NewPriorityQueue ¶
func NewPriorityQueue(lessFn apis.LessFn) *PriorityQueue
func (*PriorityQueue) Empty ¶
func (q *PriorityQueue) Empty() bool
func (*PriorityQueue) Len ¶
func (q *PriorityQueue) Len() int
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(it interface{})
type ResourceReservation ¶
ResourceReservation reserves resources in LockedNodes for TargetJob.
var Reservation *ResourceReservation
Reservation is used to record target job and locked nodes
func NewResourceReservation ¶
func NewResourceReservation() *ResourceReservation