k8s

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFrameworkHandle

func NewFrameworkHandle(pods []*v1.Pod, nodes []*v1.Node) v1alpha1.FrameworkHandle

NewFrameworkHandle creates a FrameworkHandle interface, which is used by k8s plugins.

Types

type Framework

type Framework struct {
	// contains filtered or unexported fields
}

Framework is a K8S framework who mainly provides some methods about snapshot and plugins such as predicates

func (*Framework) ClientSet

func (f *Framework) ClientSet() kubernetes.Interface

ClientSet returns a kubernetes clientset.

func (*Framework) EventRecorder added in v1.3.0

func (f *Framework) EventRecorder() events.EventRecorder

EventRecorder was introduced in k8s v1.19.6 and to be implemented

func (*Framework) GetWaitingPod

func (f *Framework) GetWaitingPod(uid types.UID) v1alpha1.WaitingPod

GetWaitingPod returns a reference to a WaitingPod given its UID.

func (*Framework) HasFilterPlugins

func (f *Framework) HasFilterPlugins() bool

HasFilterPlugins returns true if at least one filter plugin is defined.

func (*Framework) HasScorePlugins

func (f *Framework) HasScorePlugins() bool

HasScorePlugins returns true if at least one score plugin is defined.

func (*Framework) IterateOverWaitingPods

func (f *Framework) IterateOverWaitingPods(callback func(v1alpha1.WaitingPod))

IterateOverWaitingPods acquires a read lock and iterates over the WaitingPods map.

func (*Framework) ListPlugins

func (f *Framework) ListPlugins() map[string][]config.Plugin

ListPlugins returns a map of extension point name to plugin names configured at each extension point. Returns nil if no plugins where configred.

func (*Framework) PreemptHandle added in v1.3.0

func (f *Framework) PreemptHandle() v1alpha1.PreemptHandle

PreemptHandle was introduced in k8s v1.19.6 and to be implemented

func (*Framework) RejectWaitingPod

func (f *Framework) RejectWaitingPod(uid types.UID)

RejectWaitingPod rejects a WaitingPod given its UID.

func (*Framework) SharedInformerFactory

func (f *Framework) SharedInformerFactory() informers.SharedInformerFactory

SharedInformerFactory returns a shared informer factory.

func (*Framework) SnapshotSharedLister

func (f *Framework) SnapshotSharedLister() v1alpha1.SharedLister

SnapshotSharedLister returns the scheduler's SharedLister of the latest NodeInfo snapshot. The snapshot is taken at the beginning of a scheduling cycle and remains unchanged until a pod finishes "Reserve". There is no guarantee that the information remains unchanged after "Reserve".

func (*Framework) VolumeBinder

func (f *Framework) VolumeBinder() scheduling.SchedulerVolumeBinder

VolumeBinder returns the volume binder used by scheduler.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot is a snapshot of cache NodeInfo and NodeTree order. The scheduler takes a snapshot at the beginning of each scheduling cycle and uses it for its operations in that cycle.

func NewEmptySnapshot

func NewEmptySnapshot() *Snapshot

NewEmptySnapshot initializes a Snapshot struct and returns it.

func NewSnapshot

func NewSnapshot(pods []*v1.Pod, nodes []*v1.Node) *Snapshot

NewSnapshot initializes a Snapshot struct and returns it.

func (*Snapshot) Get

func (s *Snapshot) Get(nodeName string) (*v1alpha1.NodeInfo, error)

Get returns the NodeInfo of the given node name.

func (*Snapshot) HavePodsWithAffinityList

func (s *Snapshot) HavePodsWithAffinityList() ([]*v1alpha1.NodeInfo, error)

HavePodsWithAffinityList returns the list of nodes with at least one pods with inter-pod affinity

func (*Snapshot) HavePodsWithRequiredAntiAffinityList added in v1.3.0

func (s *Snapshot) HavePodsWithRequiredAntiAffinityList() ([]*v1alpha1.NodeInfo, error)

HavePodsWithRequiredAntiAffinityList returns the list of NodeInfos of nodes with pods with required anti-affinity terms.

func (*Snapshot) List

func (s *Snapshot) List() ([]*v1alpha1.NodeInfo, error)

List returns the list of nodes in the snapshot.

func (*Snapshot) NodeInfos

func (s *Snapshot) NodeInfos() v1alpha1.NodeInfoLister

NodeInfos returns a NodeInfoLister.

func (*Snapshot) Pods

func (s *Snapshot) Pods() util.PodsLister

Pods returns a PodLister

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL