Documentation ¶
Index ¶
- func ConvertAUFromPV(pv *corev1.PersistentVolume, scInformer storagev1informers.Interface) (*cache.AllocatedUnit, error)
- func ExtractPVCKey(pv *corev1.PersistentVolume) (string, error)
- func GetAllPodPvcs(pod *corev1.Pod, ctx *SchedulingContext) ([]*corev1.PersistentVolumeClaim, error)
- func GetPodPvcs(pod *corev1.Pod, ctx *SchedulingContext, skipBound bool) (err error, lvmPVCs []*corev1.PersistentVolumeClaim, ...)
- func GetPodPvcsByLister(pod *corev1.Pod, pvcLister corelisters.PersistentVolumeClaimLister, ...) (err error, lvmPVCs []*corev1.PersistentVolumeClaim, ...)
- func GetPodUnboundPvcs(pvc *corev1.PersistentVolumeClaim, ctx *SchedulingContext) (err error, lvmPVCs []*corev1.PersistentVolumeClaim, ...)
- func IsLocalNode(nodeName string, ctx *SchedulingContext) bool
- type DiskBindingResult
- type NodeBinder
- type SchedulingContext
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 GetPodUnboundPvcs ¶
func GetPodUnboundPvcs(pvc *corev1.PersistentVolumeClaim, ctx *SchedulingContext) ( 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
Click to show internal directories.
Click to hide internal directories.