Documentation ¶
Index ¶
- Constants
- func AdjustResources(ctx context.Context, cl client.Client, wl *kueue.Workload)
- func AdmissionChecksForWorkload(log logr.Logger, wl *kueue.Workload, ...) sets.Set[string]
- func AdmissionChecksStatusPatch(w *kueue.Workload, wlCopy *kueue.Workload)
- func AdmissionStatusPatch(w *kueue.Workload, wlCopy *kueue.Workload, strict bool)
- func ApplyAdmissionStatus(ctx context.Context, c client.Client, w *kueue.Workload, strict bool) error
- func ApplyAdmissionStatusPatch(ctx context.Context, c client.Client, patch *kueue.Workload) error
- func BaseSSAWorkload(w *kueue.Workload) *kueue.Workload
- func CanBePartiallyAdmitted(wl *kueue.Workload) bool
- func FindAdmissionCheck(checks []kueue.AdmissionCheckState, checkName string) *kueue.AdmissionCheckState
- func HasAllChecks(wl *kueue.Workload, mustHaveChecks sets.Set[string]) bool
- func HasAllChecksReady(wl *kueue.Workload) bool
- func HasQuotaReservation(w *kueue.Workload) bool
- func HasRejectedChecks(wl *kueue.Workload) bool
- func HasRetryChecks(wl *kueue.Workload) bool
- func IsActive(w *kueue.Workload) bool
- func IsAdmitted(w *kueue.Workload) bool
- func IsEvictedByDeactivation(w *kueue.Workload) bool
- func IsEvictedByPodsReadyTimeout(w *kueue.Workload) (*metav1.Condition, bool)
- func IsFinished(w *kueue.Workload) bool
- func Key(w *kueue.Workload) string
- func QueueKey(w *kueue.Workload) string
- func QueuedWaitTime(wl *kueue.Workload) time.Duration
- func ReclaimablePodsAreEqual(a, b []kueue.ReclaimablePod) bool
- func References(wls []*Info) []klog.ObjectRef
- func RejectedChecks(wl *kueue.Workload) []kueue.AdmissionCheckState
- func RemoveFinalizer(ctx context.Context, c client.Client, wl *kueue.Workload) error
- func ReportEvictedWorkload(recorder record.EventRecorder, wl *kueue.Workload, ...)
- func ResetChecksOnEviction(w *kueue.Workload)
- func SetAdmissionCheckState(checks *[]kueue.AdmissionCheckState, newCheck kueue.AdmissionCheckState)
- func SetDeactivationTarget(w *kueue.Workload, reason string, message string)
- func SetEvictedCondition(w *kueue.Workload, reason string, message string)
- func SetPreemptedCondition(w *kueue.Workload, reason string, message string)
- func SetQuotaReservation(w *kueue.Workload, admission *kueue.Admission)
- func SetRequeuedCondition(wl *kueue.Workload, reason, message string, status bool)
- func Status(w *kueue.Workload) string
- func SyncAdmittedCondition(w *kueue.Workload) bool
- func UnsetQuotaReservationWithCondition(wl *kueue.Workload, reason, message string) bool
- func UpdateReclaimablePods(ctx context.Context, c client.Client, w *kueue.Workload, ...) error
- func UpdateStatus(ctx context.Context, c client.Client, wl *kueue.Workload, conditionType string, ...) error
- func UseLimitsAsMissingRequestsInPod(pod *corev1.PodSpec)
- type AssignmentClusterQueueState
- type Info
- type InfoOption
- type InfoOptions
- type Ordering
- type PodSetResources
Constants ¶
const ( StatusPending = "pending" StatusQuotaReserved = "quotaReserved" StatusAdmitted = "admitted" StatusFinished = "finished" )
Variables ¶
This section is empty.
Functions ¶
func AdjustResources ¶ added in v0.4.2
AdjustResources adjusts the resource requests of a workload based on: - PodOverhead - LimitRanges - Limits
func AdmissionChecksForWorkload ¶ added in v0.7.0
func AdmissionChecksForWorkload(log logr.Logger, wl *kueue.Workload, admissionChecks map[string]sets.Set[kueue.ResourceFlavorReference]) sets.Set[string]
AdmissionChecksForWorkload returns AdmissionChecks that should be assigned to a specific Workload based on ClusterQueue configuration and ResourceFlavors
func AdmissionChecksStatusPatch ¶ added in v0.8.3
func AdmissionStatusPatch ¶ added in v0.8.0
AdmissionStatusPatch creates a new object based on the input workload that contains the admission and related conditions. The object can be used in Server-Side-Apply. If strict is true, resourceVersion will be part of the patch.
func ApplyAdmissionStatus ¶ added in v0.4.0
func ApplyAdmissionStatus(ctx context.Context, c client.Client, w *kueue.Workload, strict bool) error
ApplyAdmissionStatus updated all the admission related status fields of a workload with SSA. If strict is true, resourceVersion will be part of the patch, make this call fail if Workload was changed.
func ApplyAdmissionStatusPatch ¶ added in v0.8.0
ApplyAdmissionStatusPatch applies the patch of admission related status fields of a workload with SSA.
func BaseSSAWorkload ¶ added in v0.3.0
BaseSSAWorkload creates a new object based on the input workload that only contains the fields necessary to identify the original object. The object can be used in as a base for Server-Side-Apply.
func CanBePartiallyAdmitted ¶ added in v0.4.0
func FindAdmissionCheck ¶ added in v0.5.0
func FindAdmissionCheck(checks []kueue.AdmissionCheckState, checkName string) *kueue.AdmissionCheckState
FindAdmissionCheck - returns a pointer to the check identified by checkName if found in checks.
func HasAllChecks ¶ added in v0.5.0
HasAllChecks returns true if all the mustHaveChecks are present in the workload.
func HasAllChecksReady ¶ added in v0.5.0
HasAllChecksReady returns true if all the checks of the workload are ready.
func HasQuotaReservation ¶ added in v0.5.0
HasQuotaReservation checks if workload is admitted based on conditions
func HasRejectedChecks ¶ added in v0.8.0
HasRejectedChecks returns true if any of the workloads checks is Rejected
func HasRetryChecks ¶ added in v0.8.0
HasRetryChecks returns true if any of the workloads checks is Retry
func IsAdmitted ¶ added in v0.4.0
IsAdmitted returns true if the workload is admitted.
func IsEvictedByDeactivation ¶ added in v0.6.0
IsEvictedByDeactivation returns true if the workload is evicted by deactivation.
func IsEvictedByPodsReadyTimeout ¶ added in v0.6.0
func IsFinished ¶ added in v0.5.3
IsFinished returns true if the workload is finished.
func ReclaimablePodsAreEqual ¶ added in v0.4.0
func ReclaimablePodsAreEqual(a, b []kueue.ReclaimablePod) bool
ReclaimablePodsAreEqual checks if two Reclaimable pods are semantically equal having the same length and all keys have the same value.
func References ¶ added in v0.7.1
func References(wls []*Info) []klog.ObjectRef
func RejectedChecks ¶ added in v0.8.0
func RejectedChecks(wl *kueue.Workload) []kueue.AdmissionCheckState
RejectedChecks returns the list of Rejected admission checks
func RemoveFinalizer ¶ added in v0.5.2
func ReportEvictedWorkload ¶ added in v0.8.0
func ReportEvictedWorkload(recorder record.EventRecorder, wl *kueue.Workload, cqName, reason, message string)
func ResetChecksOnEviction ¶ added in v0.8.3
ResetChecksOnEviction sets all AdmissionChecks to Pending
func SetAdmissionCheckState ¶ added in v0.5.0
func SetAdmissionCheckState(checks *[]kueue.AdmissionCheckState, newCheck kueue.AdmissionCheckState)
SetAdmissionCheckState - adds or updates newCheck in the provided checks list.
func SetDeactivationTarget ¶ added in v0.8.0
func SetEvictedCondition ¶ added in v0.4.0
func SetPreemptedCondition ¶ added in v0.7.0
func SetQuotaReservation ¶ added in v0.5.0
SetQuotaReservation applies the provided admission to the workload. The WorkloadAdmitted and WorkloadEvicted are added or updated if necessary.
func SetRequeuedCondition ¶ added in v0.7.0
SetRequeuedCondition sets the WorkloadRequeued condition to true
func SyncAdmittedCondition ¶ added in v0.5.0
SyncAdmittedCondition sync the state of the Admitted condition with the state of QuotaReserved and AdmissionChecks. Return true if any change was done.
func UnsetQuotaReservationWithCondition ¶ added in v0.5.0
UnsetQuotaReservationWithCondition sets the QuotaReserved condition to false, clears the admission and set the WorkloadRequeued status. Returns whether any change was done.
func UpdateReclaimablePods ¶ added in v0.4.0
func UpdateReclaimablePods(ctx context.Context, c client.Client, w *kueue.Workload, reclaimablePods []kueue.ReclaimablePod) error
UpdateReclaimablePods updates the ReclaimablePods list for the workload with SSA.
func UpdateStatus ¶
func UpdateStatus(ctx context.Context, c client.Client, wl *kueue.Workload, conditionType string, conditionStatus metav1.ConditionStatus, reason, message string, managerPrefix string) error
UpdateStatus updates the condition of a workload with ssa, fieldManager being set to managerPrefix + "-" + conditionType
func UseLimitsAsMissingRequestsInPod ¶ added in v0.7.0
UseLimitsAsMissingRequestsInPod adjust the resource requests to the limits value for resources that only set limits.
Types ¶
type AssignmentClusterQueueState ¶ added in v0.7.0
type AssignmentClusterQueueState struct { LastTriedFlavorIdx []map[corev1.ResourceName]int CohortGeneration int64 ClusterQueueGeneration int64 }
func (*AssignmentClusterQueueState) Clone ¶ added in v0.7.0
func (s *AssignmentClusterQueueState) Clone() *AssignmentClusterQueueState
func (*AssignmentClusterQueueState) NextFlavorToTryForPodSetResource ¶ added in v0.7.0
func (s *AssignmentClusterQueueState) NextFlavorToTryForPodSetResource(ps int, res corev1.ResourceName) int
func (*AssignmentClusterQueueState) PendingFlavors ¶ added in v0.7.0
func (s *AssignmentClusterQueueState) PendingFlavors() bool
PendingFlavors returns whether there are pending flavors to try after the last attempt.
type Info ¶
type Info struct { Obj *kueue.Workload // list of total resources requested by the podsets. TotalRequests []PodSetResources // Populated from the queue during admission or from the admission field if // already admitted. ClusterQueue string LastAssignment *AssignmentClusterQueueState }
Info holds a Workload object and some pre-processing.
func (*Info) CanBePartiallyAdmitted ¶ added in v0.4.0
func (*Info) FlavorResourceUsage ¶ added in v0.7.0
func (i *Info) FlavorResourceUsage() resources.FlavorResourceQuantities
FlavorResourceUsage returns the total resource usage for the workload, per flavor (if assigned, otherwise flavor shows as empty string), per resource.
type InfoOption ¶ added in v0.7.0
type InfoOption func(*InfoOptions)
func WithExcludedResourcePrefixes ¶ added in v0.7.0
func WithExcludedResourcePrefixes(n []string) InfoOption
WithExcludedResourcePrefixes adds the prefixes
type InfoOptions ¶ added in v0.7.0
type InfoOptions struct {
// contains filtered or unexported fields
}
type Ordering ¶ added in v0.6.0
type Ordering struct {
PodsReadyRequeuingTimestamp config.RequeuingTimestamp
}
type PodSetResources ¶
type PodSetResources struct { Name string // Requests incorporates the requests from all pods in the podset. Requests resources.Requests // Count indicates how many pods are in the podset. Count int32 // Flavors are populated when the Workload is assigned. Flavors map[corev1.ResourceName]kueue.ResourceFlavorReference }
func (*PodSetResources) ScaledTo ¶ added in v0.4.0
func (psr *PodSetResources) ScaledTo(newCount int32) *PodSetResources