algorithm

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAUFromPV

func ConvertAUFromPV(pv *corev1.PersistentVolume, scInformer storagev1informers.Interface) (*cache.AllocatedUnit, error)

ConvertAUFromPV convert an AllocatedUnit from an bound open-local PV we assure the pv is a valid open-local pv

func ExtractPVCKey

func ExtractPVCKey(pv *corev1.PersistentVolume) (string, error)

func GetAllPodPvcs

func GetAllPodPvcs(pod *corev1.Pod, ctx *SchedulingContext) ([]*corev1.PersistentVolumeClaim, error)

func GetPodPvcs

func GetPodPvcs(pod *corev1.Pod, ctx *SchedulingContext, skipBound bool) (
	err error,
	lvmPVCs []*corev1.PersistentVolumeClaim,
	mpPVCs []*corev1.PersistentVolumeClaim,
	devicePVCs []*corev1.PersistentVolumeClaim)

GetPodPvcs returns the pending pvcs which are needed for scheduling

func GetPodPvcsByLister added in v0.6.0

func GetPodPvcsByLister(pod *corev1.Pod, pvcLister corelisters.PersistentVolumeClaimLister, scLister storagelisters.StorageClassLister, skipBound bool) (
	err error,
	lvmPVCs []*corev1.PersistentVolumeClaim,
	mpPVCs []*corev1.PersistentVolumeClaim,
	devicePVCs []*corev1.PersistentVolumeClaim)

func IsLocalNode added in v0.2.2

func IsLocalNode(nodeName string, ctx *SchedulingContext) bool

Types

type DiskBindingResult

type DiskBindingResult struct {
}

type NodeBinder

type NodeBinder interface {
	BindNode(pvc *corev1.PersistentVolumeClaim, node string) DiskBindingResult
	BindNodes(pvc *corev1.PersistentVolumeClaim) DiskBindingResult
}

NodeBinder is the interface implements the decisions for picking a piece of storage for a PersistentVolumeClaim

type SchedulingContext

type SchedulingContext struct {
	CtxLock                sync.RWMutex
	ClusterNodeCache       *cache.ClusterNodeCache
	CoreV1Informers        corev1informers.Interface
	StorageV1Informers     storagev1informers.Interface
	LocalStorageInformer   nodelocalstorageinformer.Interface
	SnapshotInformers      volumesnapshotinformers.Interface
	NodeAntiAffinityWeight *pkg.NodeAntiAffinityWeight
}

A context contains all necessary info for a extender to trigger an local volume scheduling/provisioning; these info are: 1. node cache 2. pv cache 3. nodelocalstorage cache todo: 把 informer 改为 lister

func NewSchedulingContext

func NewSchedulingContext(
	coreV1Informers corev1informers.Interface,
	storageV1informers storagev1informers.Interface,
	localStorageInformer nodelocalstorageinformer.Interface,
	snapshotInformer volumesnapshotinformers.Interface,
	weights *pkg.NodeAntiAffinityWeight,
) *SchedulingContext

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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