Documentation ¶
Index ¶
- Constants
- Variables
- func CapacityPredicate(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)
- func LuckyPredicate(pod *corev1.Pod, node *corev1.Node) (bool, []string, error)
- func Predicates(Ctx *algorithm.SchedulingContext, PredicateFuncs []PredicateFunc, ...) (fits bool, failedReasons []string, err error)
- func StorageTypePredicate(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)
- type Predicate
- type PredicateFunc
Constants ¶
View Source
const (
// LuckyPred rejects a node if you're not lucky ¯\_(ツ)_/¯
LuckyPredFailMsg = "Well, you're not lucky"
)
Variables ¶
View Source
var ( // Newly added predicates should be placed here DefaultPredicateFuncs = []PredicateFunc{ StorageTypePredicate, CapacityPredicate, } )
Functions ¶
func CapacityPredicate ¶
func CapacityPredicate(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)
CapacityPredicate checks if local storage on a node matches the persistent volume claims, follow rules are applied:
- pvc contains vg or mount point or device claim
- node free size must larger or equal to pvcs
- for pvc of type mount point/device: a. must contains more mount points than pvc count
func LuckyPredicate ¶
func Predicates ¶
func Predicates(Ctx *algorithm.SchedulingContext, PredicateFuncs []PredicateFunc, pod *corev1.Pod, node *corev1.Node) (fits bool, failedReasons []string, err error)
func StorageTypePredicate ¶ added in v0.6.0
func StorageTypePredicate(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)
StorageTypePredicate 1. if SPDK support is required, filter out the nodes without SPDK support 2. if SPDK support is unnecessary, filter out the nodes with SPDK support 3. if no volume is required, do nothing
Types ¶
type Predicate ¶
type Predicate struct { Name string Ctx *algorithm.SchedulingContext PredicateFuncs []PredicateFunc }
func NewPredicate ¶
func NewPredicate(ctx *algorithm.SchedulingContext) *Predicate
func (Predicate) Handler ¶
func (p Predicate) Handler(args schedulerapi.ExtenderArgs) (*schedulerapi.ExtenderFilterResult, error)
type PredicateFunc ¶
Click to show internal directories.
Click to hide internal directories.