k8s

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFrameworkHandle

func NewFrameworkHandle(nodeMap map[string]*framework.NodeInfo, client kubernetes.Interface, informerFactory informers.SharedInformerFactory) framework.Handle

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) AddNominatedPod added in v1.6.0

func (f *Framework) AddNominatedPod(logger klog.Logger, pod *framework.PodInfo, nominatingInfo *framework.NominatingInfo)

func (*Framework) ClientSet

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

ClientSet returns a kubernetes clientset.

func (*Framework) DeleteNominatedPodIfExists added in v1.6.0

func (f *Framework) DeleteNominatedPodIfExists(pod *v1.Pod)

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) Extenders added in v1.6.0

func (f *Framework) Extenders() []framework.Extender

func (*Framework) GetWaitingPod

func (f *Framework) GetWaitingPod(uid types.UID) framework.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(framework.WaitingPod))

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

func (*Framework) KubeConfig added in v1.6.0

func (f *Framework) KubeConfig() *rest.Config

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) NominatedPodsForNode added in v1.6.0

func (f *Framework) NominatedPodsForNode(nodeName string) []*framework.PodInfo

func (*Framework) Parallelizer added in v1.6.0

func (f *Framework) Parallelizer() parallelize.Parallelizer

func (*Framework) RejectWaitingPod

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

func (*Framework) RunFilterPlugins added in v1.6.0

func (f *Framework) RunFilterPlugins(ctx context.Context, state *framework.CycleState, pod *v1.Pod, info *framework.NodeInfo) *framework.Status

func (*Framework) RunFilterPluginsWithNominatedPods added in v1.6.0

func (f *Framework) RunFilterPluginsWithNominatedPods(ctx context.Context, state *framework.CycleState, pod *v1.Pod, info *framework.NodeInfo) *framework.Status

func (*Framework) RunPreFilterExtensionAddPod added in v1.6.0

func (f *Framework) RunPreFilterExtensionAddPod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podInfoToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*Framework) RunPreFilterExtensionRemovePod added in v1.6.0

func (f *Framework) RunPreFilterExtensionRemovePod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podInfoToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*Framework) RunPreScorePlugins added in v1.6.0

func (f *Framework) RunPreScorePlugins(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status

func (*Framework) RunScorePlugins added in v1.6.0

func (f *Framework) RunScorePlugins(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) ([]framework.NodePluginScores, *framework.Status)

func (*Framework) SharedInformerFactory

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

SharedInformerFactory returns a shared informer factory.

func (*Framework) SnapshotSharedLister

func (f *Framework) SnapshotSharedLister() framework.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) UpdateNominatedPod added in v1.6.0

func (f *Framework) UpdateNominatedPod(logger klog.Logger, oldPod *v1.Pod, newPodInfo *framework.PodInfo)

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(nodeInfoMap map[string]*framework.NodeInfo) *Snapshot

NewSnapshot initializes a Snapshot struct and returns it.

func (*Snapshot) Get

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

Get returns the NodeInfo of the given node name.

func (*Snapshot) HavePodsWithAffinityList

func (s *Snapshot) HavePodsWithAffinityList() ([]*framework.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() ([]*framework.NodeInfo, error)

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

func (*Snapshot) IsPVCUsedByPods added in v1.7.0

func (s *Snapshot) IsPVCUsedByPods(key string) bool

func (*Snapshot) List

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

List returns the list of nodes in the snapshot.

func (*Snapshot) NodeInfos

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

NodeInfos returns a NodeInfoLister.

func (*Snapshot) Pods

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

Pods returns a PodLister

func (*Snapshot) StorageInfos added in v1.7.0

func (s *Snapshot) StorageInfos() framework.StorageInfoLister

StorageInfos returns a StorageInfoLister.

Jump to

Keyboard shortcuts

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