Documentation ¶
Index ¶
- type Cache
- func (c *Cache) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error
- func (c *Cache) AddLocalQueue(q *kueue.LocalQueue) error
- func (c *Cache) AddOrUpdateResourceFlavor(rf *kueue.ResourceFlavor) sets.Set[string]
- func (c *Cache) AddOrUpdateWorkload(w *kueue.Workload) bool
- func (c *Cache) AdmittedWorkloadsInLocalQueue(localQueue *kueue.LocalQueue) int32
- func (c *Cache) AssumeWorkload(w *kueue.Workload) error
- func (c *Cache) CleanUpOnContext(ctx context.Context)
- func (c *Cache) ClusterQueueActive(name string) bool
- func (c *Cache) ClusterQueueEmpty(name string) bool
- func (c *Cache) ClusterQueueTerminating(name string) bool
- func (c *Cache) ClusterQueuesUsingFlavor(flavor string) []string
- func (c *Cache) DeleteClusterQueue(cq *kueue.ClusterQueue)
- func (c *Cache) DeleteLocalQueue(q *kueue.LocalQueue)
- func (c *Cache) DeleteResourceFlavor(rf *kueue.ResourceFlavor) sets.Set[string]
- func (c *Cache) DeleteWorkload(w *kueue.Workload) error
- func (c *Cache) ForgetWorkload(w *kueue.Workload) error
- func (c *Cache) IsAssumedOrAdmittedWorkload(w workload.Info) bool
- func (c *Cache) MatchingClusterQueues(nsLabels map[string]string) sets.Set[string]
- func (c *Cache) PodsReadyForAllAdmittedWorkloads(ctx context.Context) bool
- func (c *Cache) Snapshot() Snapshot
- func (c *Cache) TerminateClusterQueue(name string)
- func (c *Cache) UpdateClusterQueue(cq *kueue.ClusterQueue) error
- func (c *Cache) UpdateLocalQueue(oldQ, newQ *kueue.LocalQueue) error
- func (c *Cache) UpdateWorkload(oldWl, newWl *kueue.Workload) error
- func (c *Cache) Usage(cqObj *kueue.ClusterQueue) ([]kueue.FlavorUsage, int, error)
- func (c *Cache) WaitForPodsReady(ctx context.Context)
- type ClusterQueue
- type Cohort
- type FlavorQuotas
- type FlavorResourceQuantities
- type Option
- type ResourceGroup
- type ResourceQuota
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache keeps track of the Workloads that got admitted through ClusterQueues.
func (*Cache) AddClusterQueue ¶
func (*Cache) AddLocalQueue ¶ added in v0.2.0
func (c *Cache) AddLocalQueue(q *kueue.LocalQueue) error
func (*Cache) AddOrUpdateResourceFlavor ¶
func (*Cache) AdmittedWorkloadsInLocalQueue ¶ added in v0.3.0
func (c *Cache) AdmittedWorkloadsInLocalQueue(localQueue *kueue.LocalQueue) int32
func (*Cache) CleanUpOnContext ¶ added in v0.3.0
CleanUpOnContext tracks the context. When closed, it wakes routines waiting on the podsReady condition. It should be called before doing any calls to cache.WaitForPodsReady.
func (*Cache) ClusterQueueActive ¶ added in v0.2.0
func (*Cache) ClusterQueueEmpty ¶ added in v0.2.0
ClusterQueueEmpty indicates whether there's any active workload admitted by the provided clusterQueue. Return true if the clusterQueue doesn't exist.
func (*Cache) ClusterQueueTerminating ¶ added in v0.2.0
func (*Cache) ClusterQueuesUsingFlavor ¶ added in v0.3.0
func (*Cache) DeleteClusterQueue ¶
func (c *Cache) DeleteClusterQueue(cq *kueue.ClusterQueue)
func (*Cache) DeleteLocalQueue ¶ added in v0.2.0
func (c *Cache) DeleteLocalQueue(q *kueue.LocalQueue)
func (*Cache) DeleteResourceFlavor ¶
func (*Cache) IsAssumedOrAdmittedWorkload ¶ added in v0.3.0
func (*Cache) MatchingClusterQueues ¶ added in v0.2.0
func (*Cache) PodsReadyForAllAdmittedWorkloads ¶ added in v0.3.0
func (*Cache) TerminateClusterQueue ¶ added in v0.2.0
func (*Cache) UpdateClusterQueue ¶
func (c *Cache) UpdateClusterQueue(cq *kueue.ClusterQueue) error
func (*Cache) UpdateLocalQueue ¶ added in v0.2.0
func (c *Cache) UpdateLocalQueue(oldQ, newQ *kueue.LocalQueue) error
func (*Cache) Usage ¶
func (c *Cache) Usage(cqObj *kueue.ClusterQueue) ([]kueue.FlavorUsage, int, error)
Usage reports the used resources and number of workloads admitted by the ClusterQueue.
func (*Cache) WaitForPodsReady ¶ added in v0.3.0
WaitForPodsReady waits for all admitted workloads to be in the PodsReady condition if podsReadyTracking is enabled. Otherwise returns immediately.
type ClusterQueue ¶
type ClusterQueue struct { Name string Cohort *Cohort ResourceGroups []ResourceGroup RGByResource map[corev1.ResourceName]*ResourceGroup Usage FlavorResourceQuantities Workloads map[string]*workload.Info WorkloadsNotReady sets.Set[string] NamespaceSelector labels.Selector Preemption kueue.ClusterQueuePreemption Status metrics.ClusterQueueStatus // contains filtered or unexported fields }
ClusterQueue is the internal implementation of kueue.ClusterQueue that holds admitted workloads.
func (*ClusterQueue) Active ¶ added in v0.2.0
func (c *ClusterQueue) Active() bool
func (*ClusterQueue) UpdateRGByResource ¶ added in v0.3.0
func (c *ClusterQueue) UpdateRGByResource()
func (*ClusterQueue) UpdateWithFlavors ¶ added in v0.2.0
func (c *ClusterQueue) UpdateWithFlavors(flavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor)
UpdateWithFlavors updates a ClusterQueue based on the passed ResourceFlavors set. Exported only for testing.
type Cohort ¶
type Cohort struct { Name string Members sets.Set[*ClusterQueue] // These fields are only populated for a snapshot. RequestableResources FlavorResourceQuantities Usage FlavorResourceQuantities }
Cohort is a set of ClusterQueues that can borrow resources from each other.
type FlavorQuotas ¶ added in v0.3.0
type FlavorQuotas struct { Name kueue.ResourceFlavorReference Resources map[corev1.ResourceName]*ResourceQuota }
FlavorQuotas holds a processed ClusterQueue flavor quota.
type FlavorResourceQuantities ¶ added in v0.3.0
type FlavorResourceQuantities map[kueue.ResourceFlavorReference]map[corev1.ResourceName]int64
type Option ¶ added in v0.3.0
type Option func(*options)
Option configures the reconciler.
func WithPodsReadyTracking ¶ added in v0.3.0
WithPodsReadyTracking indicates the cache controller tracks the PodsReady condition for admitted workloads, and allows to block admission of new workloads until all admitted workloads are in the PodsReady condition.
type ResourceGroup ¶ added in v0.3.0
type ResourceGroup struct { CoveredResources sets.Set[corev1.ResourceName] Flavors []FlavorQuotas // The set of key labels from all flavors. // Those keys define the affinity terms of a workload // that can be matched against the flavors. LabelKeys sets.Set[string] }
type ResourceQuota ¶ added in v0.3.0
type Snapshot ¶
type Snapshot struct { ClusterQueues map[string]*ClusterQueue ResourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor InactiveClusterQueueSets sets.Set[string] }
func (*Snapshot) AddWorkload ¶ added in v0.3.0
AddWorkload removes a workload from its corresponding ClusterQueue and updates resources usage.
func (*Snapshot) RemoveWorkload ¶ added in v0.3.0
RemoveWorkload removes a workload from its corresponding ClusterQueue and updates resources usage.