core

package
v0.9.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StoppedReason = "Stopped"
)

Variables

This section is empty.

Functions

func SetupControllers

func SetupControllers(mgr ctrl.Manager, qManager *queue.Manager, cc *cache.Cache, cfg *configapi.Configuration) (string, error)

SetupControllers sets up the core controllers. It returns the name of the controller that failed to create and an error, if any.

func WithLeadingManager added in v0.6.0

func WithLeadingManager(mgr ctrl.Manager, reconciler reconcile.Reconciler, obj client.Object, cfg *config.Configuration) reconcile.Reconciler

WithLeadingManager returns a decorating reconcile.Reconciler that discards reconciliation requests for the controllers that are started with the controller.Options.NeedLeaderElection option set to false in non-leading replicas.

Starting controllers in non-leading replicas is needed for these that update the data served by the visibility extension API server.

This enables to:

  • Keep the scheduling decisions under the responsibility of the leading replica alone, to prevent any concurrency issues.
  • Consume requests from the watch event queues, to prevent them from growing indefinitely in the non-leading replicas.
  • Transition to actually reconciling requests in the replica that may acquire the leader election lease, in case the previously leading replica failed to renew it.

Types

type AdmissionCheckReconciler added in v0.5.0

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

AdmissionCheckReconciler reconciles a AdmissionCheck object

func NewAdmissionCheckReconciler added in v0.5.0

func NewAdmissionCheckReconciler(
	client client.Client,
	qMgr *queue.Manager,
	cache *cache.Cache,
) *AdmissionCheckReconciler

func (*AdmissionCheckReconciler) AddUpdateWatchers added in v0.5.0

func (r *AdmissionCheckReconciler) AddUpdateWatchers(watchers ...AdmissionCheckUpdateWatcher)

func (*AdmissionCheckReconciler) Create added in v0.5.0

func (*AdmissionCheckReconciler) Delete added in v0.5.0

func (*AdmissionCheckReconciler) Generic added in v0.5.0

func (*AdmissionCheckReconciler) NotifyClusterQueueUpdate added in v0.5.0

func (r *AdmissionCheckReconciler) NotifyClusterQueueUpdate(oldCq *kueue.ClusterQueue, newCq *kueue.ClusterQueue)

func (*AdmissionCheckReconciler) Reconcile added in v0.5.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*AdmissionCheckReconciler) SetupWithManager added in v0.5.0

func (r *AdmissionCheckReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

SetupWithManager sets up the controller with the Manager.

func (*AdmissionCheckReconciler) Update added in v0.5.0

type AdmissionCheckUpdateWatcher added in v0.5.0

type AdmissionCheckUpdateWatcher interface {
	NotifyAdmissionCheckUpdate(oldAc, newAc *kueue.AdmissionCheck)
}

type ClusterQueueReconciler

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

ClusterQueueReconciler reconciles a ClusterQueue object

func NewClusterQueueReconciler

func NewClusterQueueReconciler(
	client client.Client,
	qMgr *queue.Manager,
	cache *cache.Cache,
	opts ...ClusterQueueReconcilerOption,
) *ClusterQueueReconciler

func (*ClusterQueueReconciler) Create

func (*ClusterQueueReconciler) Delete

func (*ClusterQueueReconciler) Generic

func (*ClusterQueueReconciler) NotifyAdmissionCheckUpdate added in v0.5.0

func (r *ClusterQueueReconciler) NotifyAdmissionCheckUpdate(oldAc, newAc *kueue.AdmissionCheck)

func (*ClusterQueueReconciler) NotifyResourceFlavorUpdate added in v0.3.0

func (r *ClusterQueueReconciler) NotifyResourceFlavorUpdate(oldRF, newRF *kueue.ResourceFlavor)

NotifyResourceFlavorUpdate ignores updates since they have no impact on the ClusterQueue's readiness.

func (*ClusterQueueReconciler) NotifyWorkloadUpdate

func (r *ClusterQueueReconciler) NotifyWorkloadUpdate(oldWl, newWl *kueue.Workload)

func (*ClusterQueueReconciler) Reconcile

func (r *ClusterQueueReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ClusterQueueReconciler) SetupWithManager

func (r *ClusterQueueReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

SetupWithManager sets up the controller with the Manager.

func (*ClusterQueueReconciler) Start added in v0.5.0

func (*ClusterQueueReconciler) Update

type ClusterQueueReconcilerOption added in v0.5.0

type ClusterQueueReconcilerOption func(*ClusterQueueReconcilerOptions)

ClusterQueueReconcilerOption configures the reconciler.

func WithFairSharing added in v0.7.0

func WithFairSharing(enabled bool) ClusterQueueReconcilerOption

func WithQueueVisibilityClusterQueuesMaxCount added in v0.5.0

func WithQueueVisibilityClusterQueuesMaxCount(value int32) ClusterQueueReconcilerOption

WithQueueVisibilityClusterQueuesMaxCount indicates the maximal number of pending workloads exposed in the cluster queue status

func WithQueueVisibilityUpdateInterval added in v0.5.0

func WithQueueVisibilityUpdateInterval(interval time.Duration) ClusterQueueReconcilerOption

WithQueueVisibilityUpdateInterval specifies the time interval for updates to the structure of the top pending workloads in the queues.

func WithReportResourceMetrics added in v0.5.0

func WithReportResourceMetrics(report bool) ClusterQueueReconcilerOption

func WithWatchers added in v0.5.0

type ClusterQueueReconcilerOptions added in v0.5.0

type ClusterQueueReconcilerOptions struct {
	Watchers                             []ClusterQueueUpdateWatcher
	ReportResourceMetrics                bool
	FairSharingEnabled                   bool
	QueueVisibilityUpdateInterval        time.Duration
	QueueVisibilityClusterQueuesMaxCount int32
}

type ClusterQueueUpdateWatcher added in v0.2.0

type ClusterQueueUpdateWatcher interface {
	NotifyClusterQueueUpdate(*kueue.ClusterQueue, *kueue.ClusterQueue)
}

type CohortReconciler added in v0.9.0

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

CohortReconciler is responsible for synchronizing the in-memory representation of Cohorts in cache.Cache and queue.Manager with Cohort Kubernetes objects.

func NewCohortReconciler added in v0.9.0

func NewCohortReconciler(client client.Client, cache *cache.Cache, qManager *queue.Manager) CohortReconciler

func (*CohortReconciler) Create added in v0.9.0

func (r *CohortReconciler) Create(e event.CreateEvent) bool

func (*CohortReconciler) Delete added in v0.9.0

func (r *CohortReconciler) Delete(e event.DeleteEvent) bool

func (*CohortReconciler) Generic added in v0.9.0

func (r *CohortReconciler) Generic(e event.GenericEvent) bool

func (*CohortReconciler) Reconcile added in v0.9.0

func (r *CohortReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*CohortReconciler) SetupWithManager added in v0.9.0

func (r *CohortReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

func (*CohortReconciler) Update added in v0.9.0

func (r *CohortReconciler) Update(e event.UpdateEvent) bool

type LocalQueueReconciler added in v0.2.0

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

LocalQueueReconciler reconciles a LocalQueue object

func NewLocalQueueReconciler added in v0.2.0

func NewLocalQueueReconciler(client client.Client, queues *queue.Manager, cache *cache.Cache) *LocalQueueReconciler

func (*LocalQueueReconciler) Create added in v0.2.0

func (*LocalQueueReconciler) Delete added in v0.2.0

func (*LocalQueueReconciler) Generic added in v0.2.0

func (*LocalQueueReconciler) NotifyWorkloadUpdate added in v0.2.0

func (r *LocalQueueReconciler) NotifyWorkloadUpdate(oldWl, newWl *kueue.Workload)

func (*LocalQueueReconciler) Reconcile added in v0.2.0

func (r *LocalQueueReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*LocalQueueReconciler) SetupWithManager added in v0.2.0

func (r *LocalQueueReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

SetupWithManager sets up the controller with the Manager.

func (*LocalQueueReconciler) Update added in v0.2.0

func (*LocalQueueReconciler) UpdateStatusIfChanged added in v0.3.0

func (r *LocalQueueReconciler) UpdateStatusIfChanged(
	ctx context.Context,
	queue *kueue.LocalQueue,
	conditionStatus metav1.ConditionStatus,
	reason, msg string,
) error

type Option added in v0.3.0

type Option func(*options)

Option configures the reconciler.

func WithWaitForPodsReady added in v0.7.0

func WithWaitForPodsReady(value *waitForPodsReadyConfig) Option

WithWaitForPodsReady indicates the configuration for the WaitForPodsReady feature.

func WithWorkloadUpdateWatchers added in v0.3.0

func WithWorkloadUpdateWatchers(value ...WorkloadUpdateWatcher) Option

WithWorkloadUpdateWatchers allows to specify the workload update watchers

type ResourceFlavorReconciler

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

ResourceFlavorReconciler reconciles a ResourceFlavor object

func NewResourceFlavorReconciler

func NewResourceFlavorReconciler(
	client client.Client,
	qMgr *queue.Manager,
	cache *cache.Cache,
) *ResourceFlavorReconciler

func (*ResourceFlavorReconciler) AddUpdateWatcher added in v0.3.0

func (r *ResourceFlavorReconciler) AddUpdateWatcher(watchers ...ResourceFlavorUpdateWatcher)

func (*ResourceFlavorReconciler) Create

func (*ResourceFlavorReconciler) Delete

func (*ResourceFlavorReconciler) Generic

func (*ResourceFlavorReconciler) NotifyClusterQueueUpdate added in v0.2.0

func (r *ResourceFlavorReconciler) NotifyClusterQueueUpdate(oldCQ, newCQ *kueue.ClusterQueue)

NotifyClusterQueueUpdate will listen for the update/delete events of clusterQueues to help verifying whether resourceFlavors are no longer in use by clusterQueues. There are mainly two reasons for this, 1) a clusterQueue is deleted 2) a clusterQueue is updated with the resourceFlavors in use.

func (*ResourceFlavorReconciler) Reconcile

func (*ResourceFlavorReconciler) SetupWithManager

func (r *ResourceFlavorReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

SetupWithManager sets up the controller with the Manager.

func (*ResourceFlavorReconciler) Update

type ResourceFlavorUpdateWatcher added in v0.3.0

type ResourceFlavorUpdateWatcher interface {
	NotifyResourceFlavorUpdate(oldRF, newRF *kueue.ResourceFlavor)
}

type WorkloadReconciler

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

WorkloadReconciler reconciles a Workload object

func NewWorkloadReconciler

func NewWorkloadReconciler(client client.Client, queues *queue.Manager, cache *cache.Cache, recorder record.EventRecorder, opts ...Option) *WorkloadReconciler

func (*WorkloadReconciler) Create

func (*WorkloadReconciler) Delete

func (*WorkloadReconciler) Generic

func (r *WorkloadReconciler) Generic(e event.GenericEvent) bool

func (*WorkloadReconciler) Reconcile

func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*WorkloadReconciler) SetupWithManager

func (r *WorkloadReconciler) SetupWithManager(mgr ctrl.Manager, cfg *config.Configuration) error

SetupWithManager sets up the controller with the Manager.

func (*WorkloadReconciler) Update

type WorkloadUpdateWatcher

type WorkloadUpdateWatcher interface {
	NotifyWorkloadUpdate(oldWl, newWl *kueue.Workload)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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