predicates

package
v0.5.4-dev-ipv6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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{

		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:

  1. pvc contains vg or mount point or device claim
  2. node free size must larger or equal to pvcs
  3. for pvc of type mount point/device: a. must contains more mount points than pvc count

func LuckyPredicate

func LuckyPredicate(pod *corev1.Pod, node *corev1.Node) (bool, []string, error)

func Predicates

func Predicates(Ctx *algorithm.SchedulingContext, PredicateFuncs []PredicateFunc, pod *corev1.Pod, node *corev1.Node) (fits bool, failedReasons []string, err error)

func SnapshotPredicate

func SnapshotPredicate(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)

SnapshotPredicate checks if node of the source pv is source node

Types

type Predicate

type Predicate struct {
	Name           string
	Ctx            *algorithm.SchedulingContext
	PredicateFuncs []PredicateFunc
}

func NewPredicate

func NewPredicate(ctx *algorithm.SchedulingContext) *Predicate

func (Predicate) Handler

type PredicateFunc

type PredicateFunc func(ctx *algorithm.SchedulingContext, pod *corev1.Pod, node *corev1.Node) (bool, error)

Jump to

Keyboard shortcuts

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