Documentation ¶
Overview ¶
The scheduler is responsible for placing virtual pod (VPod) replicas within real pods.
Index ¶
- Constants
- Variables
- func GetPlacementForPod(placements []duckv1alpha1.Placement, podName string) *duckv1alpha1.Placement
- func GetPodCount(placements []duckv1alpha1.Placement) int
- func GetTotalVReplicas(placements []duckv1alpha1.Placement) int32
- type Evictor
- type PredicatePolicy
- type PriorityPolicy
- type Scheduler
- type SchedulerPolicy
- type SchedulerPolicyType
- type VPod
- type VPodLister
Constants ¶
const ( // MaxWeight is the maximum weight that can be assigned for a priority. MaxWeight uint64 = 10 // MinWeight is the minimum weight that can be assigned for a priority. MinWeight uint64 = 0 )
const (
ZoneLabel = "topology.kubernetes.io/zone"
)
Variables ¶
var (
ErrNotEnoughReplicas = errors.New("scheduling failed (not enough pod replicas)")
)
Functions ¶
func GetPlacementForPod ¶
func GetPlacementForPod(placements []duckv1alpha1.Placement, podName string) *duckv1alpha1.Placement
GetPlacementForPod returns the placement corresponding to podName
func GetPodCount ¶ added in v0.22.4
func GetPodCount(placements []duckv1alpha1.Placement) int
GetPodCount returns the number of pods with the given placements
func GetTotalVReplicas ¶
func GetTotalVReplicas(placements []duckv1alpha1.Placement) int32
GetTotalVReplicas returns the total number of placed virtual replicas
Types ¶
type Evictor ¶ added in v0.24.0
Evictor allows for vreplicas to be evicted. For instance, the evictor is used by the statefulset scheduler to move vreplicas to pod with a lower ordinal.
type PredicatePolicy ¶ added in v0.26.0
type PredicatePolicy struct { // Identifier of the predicate policy Name string // Holds the parameters to configure the given predicate Args interface{} }
PredicatePolicy describes a struct of a predicate policy.
type PriorityPolicy ¶ added in v0.26.0
type PriorityPolicy struct { // Identifier of the priority policy Name string // The numeric multiplier for the pod scores that the priority function generates // The weight should be a positive integer Weight uint64 // Holds the parameters to configure the given priority function Args interface{} }
PriorityPolicy describes a struct of a priority policy.
type Scheduler ¶
type Scheduler interface { // Schedule computes the new set of placements for vpod. Schedule(vpod VPod) ([]duckv1alpha1.Placement, error) }
Scheduler is responsible for placing VPods into real Kubernetes pods
type SchedulerPolicy ¶ added in v0.26.0
type SchedulerPolicy struct { // Holds the information to configure the fit predicate functions. Predicates []PredicatePolicy // Holds the information to configure the priority functions. Priorities []PriorityPolicy }
Policy describes a struct of a policy resource.
type SchedulerPolicyType ¶ added in v0.26.0
type SchedulerPolicyType string
const ( // MAXFILLUP policy type adds vreplicas to existing pods to fill them up before adding to new pods MAXFILLUP SchedulerPolicyType = "MAXFILLUP" )
type VPod ¶
type VPod interface { // GetKey returns the VPod key (namespace/name). GetKey() types.NamespacedName // GetVReplicas returns the number of expected virtual replicas GetVReplicas() int32 // GetPlacements returns the current list of placements // Do not mutate! GetPlacements() []duckv1alpha1.Placement GetResourceVersion() string }
VPod represents virtual replicas placed into real Kubernetes pods The scheduler is responsible for placing VPods
type VPodLister ¶
VPodLister is the function signature for returning a list of VPods