Documentation ¶
Overview ¶
Package scheduler is responsible for placing virtual pod (VPod) replicas within real pods.
Index ¶
- Constants
- func GetTotalVReplicas(placements []duckv1alpha1.Placement) int32
- type Evictor
- type ScaleCache
- func (sc *ScaleCache) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
- func (sc *ScaleCache) Reset()
- func (sc *ScaleCache) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, ...) (*autoscalingv1.Scale, error)
- type ScaleCacheConfig
- type ScaleClient
- type Scheduler
- type SchedulerFunc
- type VPod
- type VPodLister
Constants ¶
const ( // PodAnnotationKey is an annotation used by the scheduler to be informed of pods // being evicted and not use it for placing vreplicas PodAnnotationKey = "eventing.knative.dev/unschedulable" )
Variables ¶
This section is empty.
Functions ¶
func GetTotalVReplicas ¶
func GetTotalVReplicas(placements []duckv1alpha1.Placement) int32
GetTotalVReplicas returns the total number of placed virtual replicas
Types ¶
type Evictor ¶
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 ScaleCache ¶ added in v0.41.0
type ScaleCache struct {
// contains filtered or unexported fields
}
func NewScaleCache ¶ added in v0.41.0
func NewScaleCache(ctx context.Context, namespace string, scaleClient ScaleClient, config ScaleCacheConfig) *ScaleCache
func (*ScaleCache) GetScale ¶ added in v0.41.0
func (sc *ScaleCache) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
func (*ScaleCache) Reset ¶ added in v0.41.0
func (sc *ScaleCache) Reset()
func (*ScaleCache) UpdateScale ¶ added in v0.41.0
func (sc *ScaleCache) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
type ScaleCacheConfig ¶ added in v0.41.0
type ScaleClient ¶ added in v0.41.0
type ScaleClient interface { GetScale(ctx context.Context, name string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, name string, scale *autoscalingv1.Scale, options metav1.UpdateOptions) (*autoscalingv1.Scale, error) }
type Scheduler ¶
type Scheduler interface { // Schedule computes the new set of placements for vpod. Schedule(ctx context.Context, vpod VPod) ([]duckv1alpha1.Placement, error) }
Scheduler is responsible for placing VPods into real Kubernetes pods
type SchedulerFunc ¶ added in v0.29.0
SchedulerFunc type is an adapter to allow the use of ordinary functions as Schedulers. If f is a function with the appropriate signature, SchedulerFunc(f) is a Scheduler that calls f.
func (SchedulerFunc) Schedule ¶ added in v0.29.0
func (f SchedulerFunc) Schedule(ctx context.Context, vpod VPod) ([]duckv1alpha1.Placement, error)
Schedule implements the Scheduler interface.
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