arbitrator

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPassedArbitration = "descheduler.koordinator.sh/passed-arbitration"
	AnnotationPodArbitrating    = "descheduler.koordinator.sh/pod-arbitrating"
)
View Source
const (
	JobKind = "Job"
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(arbitrator Arbitrator, client client.Client) handler.EventHandler

Types

type Arbitrator

type Arbitrator interface {
	MigrationFilter
	AddPodMigrationJob(job *v1alpha1.PodMigrationJob)
	DeletePodMigrationJob(job *v1alpha1.PodMigrationJob)
}

func New

func New(args *config.MigrationControllerArgs, options Options) (Arbitrator, error)

New creates an arbitratorImpl based on parameters.

type MigrationFilter

type MigrationFilter interface {
	Filter(pod *corev1.Pod) bool
	PreEvictionFilter(pod *corev1.Pod) bool
	TrackEvictedPod(pod *corev1.Pod)
}

type Options

type Options struct {
	Client        client.Client
	EventRecorder events.EventRecorder
	Manager       controllerruntime.Manager
	Handle        framework.Handle
}

type SortFn

type SortFn func(jobs []*v1alpha1.PodMigrationJob, podOfJob map[*v1alpha1.PodMigrationJob]*corev1.Pod) []*v1alpha1.PodMigrationJob

SortFn stably sorts PodMigrationJobs slice based on a certain strategy. Users can implement different SortFn according to their needs.

func SortJobsByController

func SortJobsByController() SortFn

SortJobsByController returns a SortFn that places PodMigrationJobs in the same job in adjacent positions.

func SortJobsByCreationTime

func SortJobsByCreationTime() SortFn

SortJobsByCreationTime returns a SortFn that stably sorts PodMigrationJobs by create time.

func SortJobsByMigratingNum

func SortJobsByMigratingNum(c client.Client) SortFn

SortJobsByMigratingNum returns a SortFn that stably sorts PodMigrationJobs the number of migrating PMJs in the same Job.

func SortJobsByPod

func SortJobsByPod(sorter func(pods []*corev1.Pod)) SortFn

SortJobsByPod sort a SortFn that sorts PodMigrationJobs by their Pods, including priority, QoS.

Jump to

Keyboard shortcuts

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