Documentation ¶
Overview ¶
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func AdjustResources(ctx context.Context, cl client.Client, wl *kueue.Workload)
- func ApplyAdmissionStatus(ctx context.Context, c client.Client, w *kueue.Workload, strict bool) error
- func BaseSSAWorkload(w *kueue.Workload) *kueue.Workload
- func CanBePartiallyAdmitted(wl *kueue.Workload) bool
- func FindAdmissionCheck(checks []kueue.AdmissionCheckState, checkName string) *kueue.AdmissionCheckState
- func GetQueueOrderTimestamp(w *kueue.Workload) *metav1.Time
- func GetRejectedChecks(wl *kueue.Workload) []string
- func HasAllChecks(wl *kueue.Workload, mustHaveChecks sets.Set[string]) bool
- func HasAllChecksReady(wl *kueue.Workload) bool
- func HasQuotaReservation(w *kueue.Workload) bool
- func HasRetryOrRejectedChecks(wl *kueue.Workload) bool
- func IsAdmitted(w *kueue.Workload) bool
- func Key(w *kueue.Workload) string
- func QueueKey(w *kueue.Workload) string
- func ReclaimablePodsAreEqual(a, b []kueue.ReclaimablePod) bool
- func ResourceQuantity(name corev1.ResourceName, v int64) resource.Quantity
- func ResourceValue(name corev1.ResourceName, q resource.Quantity) int64
- func SetAdmissionCheckState(checks *[]kueue.AdmissionCheckState, newCheck kueue.AdmissionCheckState)
- func SetEvictedCondition(w *kueue.Workload, reason string, message string)
- func SetQuotaReservation(w *kueue.Workload, admission *kueue.Admission)
- func SyncAdmittedCondition(w *kueue.Workload) bool
- func UnsetQuotaReservationWithCondition(wl *kueue.Workload, reason, message string)
- 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
- type AssigmentClusterQueueState
- type Info
- type PodSetResources
- type Requests
Constants ¶
This section is empty.
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 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 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
FindStatusCondition - returns a pointer to the check identified by checkName if found in checks.
func GetQueueOrderTimestamp ¶ added in v0.4.0
GetQueueOrderTimestamp return the timestamp to be used by the scheduler. It could be the workload creation time or the last time a PodsReady timeout has occurred.
func GetRejectedChecks ¶ added in v0.5.0
Returns the list of Rejected admission checks
func HasAllChecks ¶ added in v0.5.0
Returns true if all the mustHaveChecks are present in the workload.
func HasAllChecksReady ¶ added in v0.5.0
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 HasRetryOrRejectedChecks ¶ added in v0.5.0
Returns true if any of the workloads checks are Retry or Rejected
func IsAdmitted ¶ added in v0.4.0
Returns true if the workload is admitted.
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 ResourceQuantity ¶
func ResourceQuantity(name corev1.ResourceName, v int64) resource.Quantity
func ResourceValue ¶
func ResourceValue(name corev1.ResourceName, q resource.Quantity) int64
ResourceValue returns the integer value for the resource name. It's milli-units for CPU and absolute units for everything else.
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 SetEvictedCondition ¶ added in v0.4.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 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
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 wit 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, filelManager being set to managerPrefix + "-" + conditionType
Types ¶
type AssigmentClusterQueueState ¶ added in v0.5.0
type AssigmentClusterQueueState struct { LastTriedFlavorIdx []map[corev1.ResourceName]int CohortGeneration int64 ClusterQueueGeneration int64 }
func (*AssigmentClusterQueueState) Clone ¶ added in v0.5.0
func (s *AssigmentClusterQueueState) Clone() *AssigmentClusterQueueState
func (*AssigmentClusterQueueState) PendingFlavors ¶ added in v0.5.1
func (s *AssigmentClusterQueueState) 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 *AssigmentClusterQueueState }
Info holds a Workload object and some pre-processing.
func (*Info) CanBePartiallyAdmitted ¶ added in v0.4.0
type PodSetResources ¶
type PodSetResources struct { Name string Requests Requests Count int32 Flavors map[corev1.ResourceName]kueue.ResourceFlavorReference }
func (*PodSetResources) ScaledTo ¶ added in v0.4.0
func (psr *PodSetResources) ScaledTo(newCount int32) *PodSetResources
type Requests ¶
type Requests map[corev1.ResourceName]int64
Requests maps ResourceName to flavor to value; for CPU it is tracked in MilliCPU.
func (Requests) ToResourceList ¶ added in v0.3.0
func (r Requests) ToResourceList() corev1.ResourceList