scheduler

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

The scheduler is responsible for placing virtual pod (VPod) replicas within real pods.

Index

Constants

This section is empty.

Variables

View Source
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 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 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
}

VPod represents virtual replicas placed into real Kubernetes pods The scheduler is responsible for placing VPods

type VPodLister

type VPodLister func() ([]VPod, error)

VPodLister is the function signature for returning a list of VPods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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