scheduler

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const MaxHAVolumeCount = 1000

MaxHAVolumeCount

View Source
const (
	Name = "hwameistor-scheduler-plugin"
)

Name is the name of the plugin used in Registry and configurations.

View Source
const VolumeClaim = "PersistentVolumeClaim"
View Source
const VolumeSnapshot = "VolumeSnapshot"

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type LVMVolumeScheduler

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

func (*LVMVolumeScheduler) CSIDriverName

func (s *LVMVolumeScheduler) CSIDriverName() string

func (*LVMVolumeScheduler) Filter

func (s *LVMVolumeScheduler) Filter(lvs []string, pendingPVCs []*corev1.PersistentVolumeClaim, node *corev1.Node) (bool, error)

func (*LVMVolumeScheduler) Reserve

func (s *LVMVolumeScheduler) Reserve(pendingPVCs []*corev1.PersistentVolumeClaim, node string) error

func (*LVMVolumeScheduler) Score added in v0.7.2

func (s *LVMVolumeScheduler) Score(unboundPVCs []*corev1.PersistentVolumeClaim, node string) (int64, error)

Score node according to volume nums and storage pool capacity. For now, we only consider storage capacity, calculate logic is as bellow: volume capacity / poolFreeCapacity less, score higher

func (*LVMVolumeScheduler) Unreserve

func (s *LVMVolumeScheduler) Unreserve(pendingPVCs []*corev1.PersistentVolumeClaim, node string) error

type Plugin

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

func (*Plugin) Filter

func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, node *framework.NodeInfo) *framework.Status

Filter is the functions invoked by the framework at "filter" extension point.

func (Plugin) Name

func (p Plugin) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*Plugin) Reserve

func (p *Plugin) Reserve(_ context.Context, _ *framework.CycleState, pod *v1.Pod, node string) *framework.Status

Reserve is the functions invoked by the framework at "reserve" extension point.

func (*Plugin) Score added in v0.7.2

func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, node string) (int64, *framework.Status)

Score is the functions invoked by framework at "score" extension point

func (*Plugin) ScoreExtensions added in v0.7.2

func (p *Plugin) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions is the functions invoked by framework at "score extension" extension point

func (*Plugin) Unreserve

func (p *Plugin) Unreserve(_ context.Context, _ *framework.CycleState, pod *v1.Pod, node string)

Unreserve is the functions invoked by the framework at "unreserve" extension point.

type Scheduler

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

VolumeScheduler is to scheduler hwameistor volume

func NewScheduler

func NewScheduler(f framework.Handle) *Scheduler

NewDataCache creates a cache instance

func (*Scheduler) Filter

func (s *Scheduler) Filter(pod *corev1.Pod, node *corev1.Node) (bool, error)

func (*Scheduler) Reserve

func (s *Scheduler) Reserve(pod *corev1.Pod, node string) error

func (*Scheduler) Score added in v0.7.2

func (s *Scheduler) Score(pod *corev1.Pod, node string) (int64, error)

func (*Scheduler) Unreserve

func (s *Scheduler) Unreserve(pod *corev1.Pod, node string) error

type VolumeScheduler

type VolumeScheduler interface {
	Filter(existingLocalVolume []string, unboundPVCs []*v1.PersistentVolumeClaim, node *v1.Node) (bool, error)
	Reserve(unboundPVCs []*v1.PersistentVolumeClaim, node string) error
	Unreserve(unboundPVCs []*v1.PersistentVolumeClaim, node string) error
	Score(unboundPVCs []*v1.PersistentVolumeClaim, node string) (int64, error)
	CSIDriverName() string
}

func NewDiskVolumeScheduler

func NewDiskVolumeScheduler(f framework.Handle) VolumeScheduler

func NewLVMVolumeScheduler

func NewLVMVolumeScheduler(f framework.Handle, scheduler v1alpha1.VolumeScheduler, hwameiStorCache cache.Cache, cli client.Client) VolumeScheduler

Jump to

Keyboard shortcuts

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