scheduler

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAcceptableReplicasKey = "default"

	// DefaultSchedulerName is the default scheduler name
	DefaultSchedulerName = "default"
)
View Source
const (
	// RootPathReplicas specifies the root path for predictor replica server
	RootPathReplicas = "/replicas"

	// SubPathPredict specifies the sub path for predicting replicas
	SubPathPredict = "/predict"

	// SubPathUnscheduled specifies the sub path for listing unscheduled replicas
	SubPathUnscheduled = "/unscheduled"
)
View Source
const (
	// ClusterIDHeader is the HTTP header name used by replicas predictor
	ClusterIDHeader = "Cluster-ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PredictorProvider

type PredictorProvider interface {
	// MaxAcceptableReplicas indicates the maximum acceptable replicas that the cluster could admit.
	// It returns a map of label to maximum acceptable replicas with this constraint. Here the label constraint
	// could be topology constraints, such as
	// {
	//    "topology.kubernetes.io/zone=zone1,topology.kubernetes.io/region=region1": 3,
	//    "topology.kubernetes.io/zone=zone2,topology.kubernetes.io/region=region1": 5,
	// }.
	MaxAcceptableReplicas(ctx context.Context, requirements v1alpha1.ReplicaRequirements) (PredictorResults, error)

	// UnschedulableReplicas returns current unschedulable replicas.
	UnschedulableReplicas(ctx context.Context, gvk metav1.GroupVersionKind, namespacedName string,
		labelSelector map[string]string) (int32, error)
}

PredictorProvider is an interface that provides replicas predictions.

type PredictorReplicas added in v0.11.0

type PredictorReplicas map[string]int32

PredictorReplicas indicates a map of label to replicas with this constraint. Here the label constraint could be topology constraints, such as

{
   "topology.kubernetes.io/zone=zone1,topology.kubernetes.io/region=region1": 3,
   "topology.kubernetes.io/zone=zone2,topology.kubernetes.io/region=region1": 5,
}.

type PredictorResults added in v0.11.0

type PredictorResults struct {
	// Replicas records the max acceptable replicas in this cluster
	Replicas PredictorReplicas `json:"replicas,omitempty"`
}

PredictorResults specify

Jump to

Keyboard shortcuts

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