Documentation ¶
Index ¶
- Constants
- func GenerateNodeMapAndSlice(nodes map[string]*api.NodeInfo) (map[string]*schedulernodeinfo.NodeInfo, []*v1.Node)
- func HaveAffinity(pod *v1.Pod) bool
- type CachedNodeInfo
- type NodeLister
- type PodAffinityLister
- type PodFilter
- type PodLister
- func (pl *PodLister) AffinityFilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) AffinityLister() *PodAffinityLister
- func (pl *PodLister) FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) GetPod(task *api.TaskInfo) *v1.Pod
- func (pl *PodLister) List(selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) UpdateTask(task *api.TaskInfo, nodeName string) *v1.Pod
- type PodsLister
Constants ¶
const ( // Permit indicates that plugin callback function permits job to be inqueue, pipelined, or other status Permit = 1 // Abstain indicates that plugin callback function abstains in voting job to be inqueue, pipelined, or other status Abstain = 0 // Reject indicates that plugin callback function rejects job to be inqueue, pipelined, or other status Reject = -1 )
Variables ¶
This section is empty.
Functions ¶
func GenerateNodeMapAndSlice ¶
func GenerateNodeMapAndSlice(nodes map[string]*api.NodeInfo) (map[string]*schedulernodeinfo.NodeInfo, []*v1.Node)
GenerateNodeMapAndSlice returns the nodeMap and nodeSlice generated from ssn
func HaveAffinity ¶
HaveAffinity checks pod have affinity or not
Types ¶
type CachedNodeInfo ¶
CachedNodeInfo is used in nodeorder and predicate plugin
func (*CachedNodeInfo) GetNodeInfo ¶
func (c *CachedNodeInfo) GetNodeInfo(name string) (*v1.Node, error)
GetNodeInfo is used to get info of a particular node
type NodeLister ¶
NodeLister is used in nodeorder plugin
type PodAffinityLister ¶
type PodAffinityLister struct {
// contains filtered or unexported fields
}
PodAffinityLister is used to list pod with affinity
func (*PodAffinityLister) FilteredList ¶
func (pal *PodAffinityLister) FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
FilteredList is used to list all the pods with affinity under filter condition
type PodFilter ¶ added in v1.3.0
PodFilter is a function to filter a pod. If pod passed return true else return false.
type PodLister ¶
type PodLister struct { Session *framework.Session CachedPods map[api.TaskID]*v1.Pod Tasks map[api.TaskID]*api.TaskInfo TaskWithAffinity map[api.TaskID]*api.TaskInfo }
PodLister is used in predicate and nodeorder plugin
func NewPodLister ¶
NewPodLister returns a PodLister generate from ssn
func NewPodListerFromNode ¶ added in v1.2.0
NewPodListerFromNode returns a PodLister generate from ssn
func (*PodLister) AffinityFilteredList ¶
func (pl *PodLister) AffinityFilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
AffinityFilteredList is used to list all the pods with affinity under filter condition
func (*PodLister) AffinityLister ¶
func (pl *PodLister) AffinityLister() *PodAffinityLister
AffinityLister generate a PodAffinityLister following current PodLister
func (*PodLister) FilteredList ¶
FilteredList is used to list all the pods under filter condition
func (*PodLister) GetPod ¶
GetPod will get pod with proper nodeName, from cache or DeepCopy keeping this function read only to avoid concurrent panic of map
type PodsLister ¶ added in v1.3.0
type PodsLister interface { // Returns the list of pods. List(labels.Selector) ([]*v1.Pod, error) // This is similar to "List()", but the returned slice does not // contain pods that don't pass `podFilter`. FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error) }
PodsLister interface represents anything that can list pods for a scheduler.