Documentation ¶
Index ¶
- func BuildBestEffortPod(namespace, name, nodeName string, p v1.PodPhase, groupName string, ...) *v1.Pod
- func BuildDynamicPVC(namespace, name string, req v1.ResourceList) (*v1.PersistentVolumeClaim, *v1.PersistentVolume, *storagev1.StorageClass)
- func BuildNode(name string, alloc v1.ResourceList, labels map[string]string) *v1.Node
- func BuildPod(namespace, name, nodeName string, p v1.PodPhase, req v1.ResourceList, ...) *v1.Pod
- func BuildPodWithPVC(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, ...) *v1.Pod
- func BuildPodWithPriority(namespace, name, nodeName string, p v1.PodPhase, req v1.ResourceList, ...) *v1.Pod
- func BuildResourceList(cpu string, memory string) v1.ResourceList
- func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
- func CalculateNumOfFeasibleNodesToFind(numAllNodes int32) (numNodes int32)
- func GetMinInt(vals ...int) int
- func GetNodeList(nodes map[string]*api.NodeInfo, nodeList []string) []*api.NodeInfo
- func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, ...) map[float64][]*api.NodeInfo
- func SelectBestNode(nodeScores map[float64][]*api.NodeInfo) *api.NodeInfo
- func SortNodes(nodeScores map[float64][]*api.NodeInfo) []*api.NodeInfo
- func ValidateVictims(preemptor *api.TaskInfo, node *api.NodeInfo, victims []*api.TaskInfo) error
- type FakeBinder
- type FakeEvictor
- type FakeStatusUpdater
- type FakeVolumeBinder
- func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string, podVolumes *volumescheduling.PodVolumes) error
- func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes) error
- func (fvb *FakeVolumeBinder) GetPodVolumes(task *api.TaskInfo, node *v1.Node) (*volumescheduling.PodVolumes, error)
- func (fvb *FakeVolumeBinder) RevertVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes)
- type PredicateHelper
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBestEffortPod ¶ added in v1.6.0
func BuildBestEffortPod(namespace, name, nodeName string, p v1.PodPhase, groupName string, labels map[string]string, selector map[string]string) *v1.Pod
BuildBestEffortPod builds a BestEffort pod object
func BuildDynamicPVC ¶ added in v1.6.0
func BuildDynamicPVC(namespace, name string, req v1.ResourceList) (*v1.PersistentVolumeClaim, *v1.PersistentVolume, *storagev1.StorageClass)
BuildDynamicPVC create pv pvc and storage class
func BuildPod ¶
func BuildPod(namespace, name, nodeName string, p v1.PodPhase, req v1.ResourceList, groupName string, labels map[string]string, selector map[string]string) *v1.Pod
BuildPod builds a Burstable pod object
func BuildPodWithPVC ¶ added in v1.6.0
func BuildPodWithPVC(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, pvc *v1.PersistentVolumeClaim, groupName string, labels map[string]string, selector map[string]string) *v1.Pod
BuildPodWithPVC builts Pod object with pvc volume
func BuildPodWithPriority ¶ added in v1.6.0
func BuildPodWithPriority(namespace, name, nodeName string, p v1.PodPhase, req v1.ResourceList, groupName string, labels map[string]string, selector map[string]string, priority *int32) *v1.Pod
BuildPodWithPriority builds a pod object with priority
func BuildResourceList ¶
func BuildResourceList(cpu string, memory string) v1.ResourceList
BuildResourceList builts resource list object
func BuildResourceListWithGPU ¶
func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
BuildResourceListWithGPU builts resource list with GPU
func CalculateNumOfFeasibleNodesToFind ¶
CalculateNumOfFeasibleNodesToFind returns the number of feasible nodes that once found, the scheduler stops its search for more feasible nodes.
func GetNodeList ¶
GetNodeList returns values of the map 'nodes'
func PrioritizeNodes ¶
func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, mapFn api.NodeOrderMapFn, reduceFn api.NodeOrderReduceFn) map[float64][]*api.NodeInfo
PrioritizeNodes returns a map whose key is node's score and value are corresponding nodes
func SelectBestNode ¶
SelectBestNode returns best node whose score is highest, pick one 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 []*api.TaskInfo) ([]*api.TaskInfo, error)
Bind used by fake binder struct to bind pods
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(p *v1.Pod, reason string) error
Evict is used by fake evictor to evict pods
func (*FakeEvictor) Evicts ¶
func (fe *FakeEvictor) Evicts() []string
Evicts returns copy of evicted pods.
type FakeStatusUpdater ¶
type FakeStatusUpdater struct { }
FakeStatusUpdater is used for fake status update
func (*FakeStatusUpdater) UpdatePodCondition ¶
func (ftsu *FakeStatusUpdater) UpdatePodCondition(pod *v1.Pod, podCondition *v1.PodCondition) (*v1.Pod, error)
UpdatePodCondition is a empty function
func (*FakeStatusUpdater) UpdatePodGroup ¶
UpdatePodGroup is a empty function
type FakeVolumeBinder ¶
type FakeVolumeBinder struct { Actions map[string][]string // contains filtered or unexported fields }
FakeVolumeBinder is used as fake volume binder
func NewFakeVolumeBinder ¶ added in v1.6.0
func NewFakeVolumeBinder(kubeClient kubernetes.Interface) *FakeVolumeBinder
NewFakeVolumeBinder create fake volume binder with kubeclient
func (*FakeVolumeBinder) AllocateVolumes ¶
func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string, podVolumes *volumescheduling.PodVolumes) error
AllocateVolumes is a empty function
func (*FakeVolumeBinder) BindVolumes ¶
func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes) error
BindVolumes is a empty function
func (*FakeVolumeBinder) GetPodVolumes ¶ added in v1.3.0
func (fvb *FakeVolumeBinder) GetPodVolumes(task *api.TaskInfo, node *v1.Node) (*volumescheduling.PodVolumes, error)
GetPodVolumes is a empty function
func (*FakeVolumeBinder) RevertVolumes ¶ added in v1.6.0
func (fvb *FakeVolumeBinder) RevertVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes)
RevertVolumes is a empty function
type PredicateHelper ¶ added in v1.5.0
type PredicateHelper interface {
PredicateNodes(task *api.TaskInfo, nodes []*api.NodeInfo, fn api.PredicateFn) ([]*api.NodeInfo, *api.FitErrors)
}
func NewPredicateHelper ¶ added in v1.5.0
func NewPredicateHelper() PredicateHelper
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a scheduling queue.
func NewPriorityQueue ¶
func NewPriorityQueue(lessFn api.LessFn) *PriorityQueue
NewPriorityQueue returns a PriorityQueue
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() interface{}
Pop pops element in the priority Queue
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(it interface{})
Push pushes element in the priority Queue