scheduler

package
v0.0.0-...-5ee5d88 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalSchedulerName         = "global-scheduler"
	PrefixedGlobalSchedulerName = common.DefaultPrefix + "global-scheduler"

	// Marks that the annotated object must follow the placement of the followed object.
	// Value is in the form G/V/R/ns/name, e.g. `types.kubeadmiral.io/v1alpha1/federateddeployments/default/fed-dp-xxx`.
	FollowsObjectAnnotation = common.DefaultPrefix + "follows-object"

	SchedulingModeAnnotation     = common.DefaultPrefix + "scheduling-mode"
	StickyClusterAnnotation      = common.DefaultPrefix + "sticky-cluster"
	StickyClusterAnnotationTrue  = "true"
	StickyClusterAnnotationFalse = "false"
	TolerationsAnnotations       = common.DefaultPrefix + "tolerations"
	PlacementsAnnotations        = common.DefaultPrefix + "placements"
	ClusterSelectorAnnotations   = common.DefaultPrefix + "clusterSelector"
	AffinityAnnotations          = common.DefaultPrefix + "affinity"
	MaxClustersAnnotations       = common.DefaultPrefix + "maxClusters"

	DefaultSchedulingMode = fedcorev1a1.SchedulingModeDuplicate

	EventReasonScheduleFederatedObject     = "ScheduleFederatedObject"
	EventReasonInvalidFollowsObject        = "InvalidFollowsObject"
	EventReasonWebhookConfigurationError   = "WebhookConfigurationError"
	EventReasonWebhookRegistered           = "WebhookRegistered"
	EventReasonParseMigrationConfiguration = "ParseMigrationConfiguration"

	SchedulingTriggersAnnotation        = common.DefaultPrefix + "scheduling-triggers"
	SchedulingDeferredReasonsAnnotation = common.DefaultPrefix + "scheduling-deferred-reasons"
)
View Source
const (
	// FedObjChanged is the event when FederatedObject/ClusterFederatedObject changes.
	FedObjChanged = "FedObjChanged"
	// PolicyChanged is the event when PropagationPolicy/ClusterPropagationPolicy changes.
	PolicyChanged = "PolicyChanged"
	// ClusterChanged is the event when cluster changes.
	ClusterChanged = "ClusterChanged"
	// FTCChanged is the event when FTC changes.
	FTCChanged = "FTCChanged"
)
View Source
const (
	SchedulerName                     = "scheduler"
	PropagationPolicyNameLabel        = common.DefaultPrefix + "propagation-policy-name"
	ClusterPropagationPolicyNameLabel = common.DefaultPrefix + "cluster-propagation-policy-name"
)

Variables

View Source
var (
	ScheduledResult     = "scheduled"
	UnschedulableResult = "unschedulable"
	ErrorResult         = "error"
)
View Source
var SchedulerSupportedPayloadVersions = sets.New(
	schedwebhookv1a1.PayloadVersion,
)

SchedulerSupportedPayloadVersions is the list of payload versions supported by the scheduler.

View Source
var SchedulingAnnotation = common.DefaultPrefix + "scheduling"

Functions

func GetMatchedPolicyKey

func GetMatchedPolicyKey(obj metav1.Object) (result common.QualifiedName, ok bool)

func UpdateReplicasOverride

func UpdateReplicasOverride(
	ftc *fedcorev1a1.FederatedTypeConfig,
	fedObject fedcorev1a1.GenericFederatedObject,
	result map[string]int64,
) (updated bool, err error)

Types

type ClusterWeight

type ClusterWeight struct {
	Cluster string
	Weight  int64
}

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(
	kubeClient kubernetes.Interface,
	fedClient fedclient.Interface,
	dynamicClient dynamic.Interface,
	fedObjectInformer fedcorev1a1informers.FederatedObjectInformer,
	clusterFedObjectInformer fedcorev1a1informers.ClusterFederatedObjectInformer,
	propagationPolicyInformer fedcorev1a1informers.PropagationPolicyInformer,
	clusterPropagationPolicyInformer fedcorev1a1informers.ClusterPropagationPolicyInformer,
	federatedClusterInformer fedcorev1a1informers.FederatedClusterInformer,
	schedulingProfileInformer fedcorev1a1informers.SchedulingProfileInformer,
	informerManager informermanager.InformerManager,
	webhookConfigurationInformer fedcorev1a1informers.SchedulerPluginWebhookConfigurationInformer,
	metrics stats.Metrics,
	logger klog.Logger,
	workerCount int,
	enableKatalystSupport bool,
) (*Scheduler, error)

func (*Scheduler) HasSynced

func (s *Scheduler) HasSynced() bool

func (*Scheduler) IsControllerReady

func (s *Scheduler) IsControllerReady() bool

func (*Scheduler) Run

func (s *Scheduler) Run(ctx context.Context)

type Scheduling

type Scheduling struct {
	// SourceGeneration is the generation of the source object
	// observed in the federated object when this placement is sampled.
	SourceGeneration int64 `json:"sourceGeneration"`

	// FederatedGeneration is the generation of the federated object
	// observed when this placement is sampled.
	FederatedGeneration int64 `json:"fedGeneration"`

	// Placement contains a list of FederatedCluster object names and replicas on them.
	Placement map[string]*int64 `json:"placement,omitempty"`
}

Jump to

Keyboard shortcuts

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