Documentation ¶
Index ¶
- Variables
- type AdmissionCheck
- type Cache
- func (c *Cache) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error
- func (c *Cache) AddLocalQueue(q *kueue.LocalQueue) error
- func (c *Cache) AddOrUpdateAdmissionCheck(ac *kueue.AdmissionCheck) sets.Set[string]
- func (c *Cache) AddOrUpdateResourceFlavor(rf *kueue.ResourceFlavor) sets.Set[string]
- func (c *Cache) AddOrUpdateWorkload(w *kueue.Workload) bool
- func (c *Cache) AdmissionChecksForClusterQueue(cqName string) []AdmissionCheck
- 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) ClusterQueueReadiness(name string) (metav1.ConditionStatus, string, string)
- func (c *Cache) ClusterQueueTerminating(name string) bool
- func (c *Cache) ClusterQueuesUsingAdmissionCheck(ac string) []string
- func (c *Cache) ClusterQueuesUsingFlavor(flavor string) []string
- func (c *Cache) DeleteAdmissionCheck(ac *kueue.AdmissionCheck) sets.Set[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) LocalQueueUsage(qObj *kueue.LocalQueue) (*LocalQueueUsageStats, error)
- func (c *Cache) MatchingClusterQueues(nsLabels map[string]string) sets.Set[string]
- func (c *Cache) PodsReadyForAllAdmittedWorkloads(log logr.Logger) 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) (*ClusterQueueUsageStats, error)
- func (c *Cache) WaitForPodsReady(ctx context.Context)
- type ClusterQueueSnapshot
- func (c *ClusterQueueSnapshot) AddUsage(frq resources.FlavorResourceQuantities)
- func (c *ClusterQueueSnapshot) Available(fr resources.FlavorResource) int64
- func (c *ClusterQueueSnapshot) Borrowing(fr resources.FlavorResource) bool
- func (c *ClusterQueueSnapshot) BorrowingWith(fr resources.FlavorResource, val int64) bool
- func (c *ClusterQueueSnapshot) DominantResourceShare() (int, corev1.ResourceName)
- func (c *ClusterQueueSnapshot) DominantResourceShareWith(wlReq resources.FlavorResourceQuantities) (int, corev1.ResourceName)
- func (c *ClusterQueueSnapshot) DominantResourceShareWithout(wlReq resources.FlavorResourceQuantities) (int, corev1.ResourceName)
- func (c *ClusterQueueSnapshot) FitInCohort(q resources.FlavorResourceQuantities) bool
- func (c *ClusterQueueSnapshot) Fits(frq resources.FlavorResourceQuantities) bool
- func (c *ClusterQueueSnapshot) PotentialAvailable(fr resources.FlavorResource) int64
- func (c *ClusterQueueSnapshot) QuotaFor(fr resources.FlavorResource) *ResourceQuota
- func (c *ClusterQueueSnapshot) RGByResource(resource corev1.ResourceName) *ResourceGroup
- func (c *ClusterQueueSnapshot) RequestableCohortQuota(fr resources.FlavorResource) (val int64)
- func (c *ClusterQueueSnapshot) UsedCohortQuota(fr resources.FlavorResource) (val int64)
- type ClusterQueueUsageStats
- type CohortSnapshot
- type LocalQueueUsageStats
- type Option
- type ResourceGroup
- type ResourceQuota
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var (
ErrCqNotFound = errors.New("cluster queue not found")
)
Functions ¶
This section is empty.
Types ¶
type AdmissionCheck ¶ added in v0.5.0
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) AddOrUpdateAdmissionCheck ¶ added in v0.5.0
func (*Cache) AddOrUpdateResourceFlavor ¶
func (*Cache) AdmissionChecksForClusterQueue ¶ added in v0.7.0
func (c *Cache) AdmissionChecksForClusterQueue(cqName string) []AdmissionCheck
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) ClusterQueueReadiness ¶ added in v0.5.0
func (*Cache) ClusterQueueTerminating ¶ added in v0.2.0
func (*Cache) ClusterQueuesUsingAdmissionCheck ¶ added in v0.5.0
func (*Cache) ClusterQueuesUsingFlavor ¶ added in v0.3.0
func (*Cache) DeleteAdmissionCheck ¶ added in v0.5.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) LocalQueueUsage ¶ added in v0.4.0
func (c *Cache) LocalQueueUsage(qObj *kueue.LocalQueue) (*LocalQueueUsageStats, error)
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) (*ClusterQueueUsageStats, error)
Usage reports the reserved and admitted resources and number of workloads holding them in 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 ClusterQueueSnapshot ¶ added in v0.8.0
type ClusterQueueSnapshot struct { Name string Cohort *CohortSnapshot ResourceGroups []ResourceGroup Usage resources.FlavorResourceQuantities Workloads map[string]*workload.Info WorkloadsNotReady sets.Set[string] NamespaceSelector labels.Selector Preemption kueue.ClusterQueuePreemption FairWeight resource.Quantity FlavorFungibility kueue.FlavorFungibility // Aggregates AdmissionChecks from both .spec.AdmissionChecks and .spec.AdmissionCheckStrategy // Sets hold ResourceFlavors to which an AdmissionCheck should apply. // In case its empty, it means an AdmissionCheck should apply to all ResourceFlavor AdmissionChecks map[string]sets.Set[kueue.ResourceFlavorReference] Status metrics.ClusterQueueStatus Quotas map[resources.FlavorResource]*ResourceQuota // GuaranteedQuota records how much resource quota the ClusterQueue reserved // when feature LendingLimit is enabled and flavor's lendingLimit is not nil. GuaranteedQuota resources.FlavorResourceQuantities // AllocatableResourceGeneration will be increased when some admitted workloads are // deleted, or the resource groups are changed. AllocatableResourceGeneration int64 }
func (*ClusterQueueSnapshot) AddUsage ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) AddUsage(frq resources.FlavorResourceQuantities)
func (*ClusterQueueSnapshot) Available ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) Available(fr resources.FlavorResource) int64
func (*ClusterQueueSnapshot) Borrowing ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) Borrowing(fr resources.FlavorResource) bool
func (*ClusterQueueSnapshot) BorrowingWith ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) BorrowingWith(fr resources.FlavorResource, val int64) bool
func (*ClusterQueueSnapshot) DominantResourceShare ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) DominantResourceShare() (int, corev1.ResourceName)
DominantResourceShare returns a value from 0 to 1,000,000 representing the maximum of the ratios of usage above nominal quota to the lendable resources in the cohort, among all the resources provided by the ClusterQueue, and divided by the weight. If zero, it means that the usage of the ClusterQueue is below the nominal quota. The function also returns the resource name that yielded this value. Also for a weight of zero, this will return 9223372036854775807.
func (*ClusterQueueSnapshot) DominantResourceShareWith ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) DominantResourceShareWith(wlReq resources.FlavorResourceQuantities) (int, corev1.ResourceName)
func (*ClusterQueueSnapshot) DominantResourceShareWithout ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) DominantResourceShareWithout(wlReq resources.FlavorResourceQuantities) (int, corev1.ResourceName)
func (*ClusterQueueSnapshot) FitInCohort ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) FitInCohort(q resources.FlavorResourceQuantities) bool
func (*ClusterQueueSnapshot) Fits ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) Fits(frq resources.FlavorResourceQuantities) bool
func (*ClusterQueueSnapshot) PotentialAvailable ¶ added in v0.8.4
func (c *ClusterQueueSnapshot) PotentialAvailable(fr resources.FlavorResource) int64
func (*ClusterQueueSnapshot) QuotaFor ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) QuotaFor(fr resources.FlavorResource) *ResourceQuota
func (*ClusterQueueSnapshot) RGByResource ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) RGByResource(resource corev1.ResourceName) *ResourceGroup
RGByResource returns the ResourceGroup which contains capacity for the resource, or nil if the CQ doesn't provide this resource.
func (*ClusterQueueSnapshot) RequestableCohortQuota ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) RequestableCohortQuota(fr resources.FlavorResource) (val int64)
RequestableCohortQuota returns the total available quota by the flavor and resource name in the cohort. LendingLimit will also be counted here if feature LendingLimit enabled. Please note that for different clusterQueues, the requestable quota is different, they should be calculated dynamically.
func (*ClusterQueueSnapshot) UsedCohortQuota ¶ added in v0.8.0
func (c *ClusterQueueSnapshot) UsedCohortQuota(fr resources.FlavorResource) (val int64)
UsedCohortQuota returns the used quota by the flavor and resource name in the cohort. Note that when LendingLimit enabled, the usage is not equal to the total used quota but the one minus the guaranteed resources, this is only for judging whether workloads fit in the cohort.
type ClusterQueueUsageStats ¶ added in v0.5.0
type ClusterQueueUsageStats struct { ReservedResources []kueue.FlavorUsage ReservingWorkloads int AdmittedResources []kueue.FlavorUsage AdmittedWorkloads int }
type CohortSnapshot ¶ added in v0.8.0
type CohortSnapshot struct { Name string Members sets.Set[*ClusterQueueSnapshot] // RequestableResources equals to the sum of LendingLimit when feature LendingLimit enabled. RequestableResources resources.FlavorResourceQuantities Usage resources.FlavorResourceQuantities Lendable map[corev1.ResourceName]int64 // AllocatableResourceGeneration equals to // the sum of allocatable generation among its members. AllocatableResourceGeneration int64 }
type LocalQueueUsageStats ¶ added in v0.5.0
type LocalQueueUsageStats struct { ReservedResources []kueue.LocalQueueFlavorUsage ReservingWorkloads int AdmittedResources []kueue.LocalQueueFlavorUsage AdmittedWorkloads int }
type Option ¶ added in v0.3.0
type Option func(*options)
Option configures the reconciler.
func WithExcludedResourcePrefixes ¶ added in v0.7.0
func WithFairSharing ¶ added in v0.7.0
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 []kueue.ResourceFlavorReference // 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] }
func (*ResourceGroup) Clone ¶ added in v0.8.1
func (rg *ResourceGroup) Clone() ResourceGroup
type ResourceQuota ¶ added in v0.3.0
type Snapshot ¶
type Snapshot struct { ClusterQueues map[string]*ClusterQueueSnapshot ResourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor InactiveClusterQueueSets sets.Set[string] }
func (*Snapshot) AddWorkload ¶ added in v0.3.0
AddWorkload adds a workload from its corresponding ClusterQueue and updates resource usage.
func (*Snapshot) RemoveWorkload ¶ added in v0.3.0
RemoveWorkload removes a workload from its corresponding ClusterQueue and updates resource usage.