Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apis/kueue/v1beta1/workload_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ const (
type WorkloadSpec struct {
// podSets is a list of sets of homogeneous pods, each described by a Pod spec
// and a count.
// There must be at least one element and at most 8.
// There must be at least one element and at most 10.
// podSets cannot be changed.
//
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
// +kubebuilder:validation:MinItems=1
PodSets []PodSet `json:"podSets"`

Expand Down Expand Up @@ -158,7 +158,7 @@ type Admission struct {
// podSetAssignments hold the admission results for each of the .spec.podSets entries.
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
PodSetAssignments []PodSetAssignment `json:"podSetAssignments"`
}

Expand Down Expand Up @@ -387,7 +387,7 @@ type WorkloadStatus struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
ReclaimablePods []ReclaimablePod `json:"reclaimablePods,omitempty"`

// admissionChecks list all the admission checks required by the workload and the current status
Expand All @@ -407,7 +407,7 @@ type WorkloadStatus struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
ResourceRequests []PodSetRequest `json:"resourceRequests,omitempty"`

// accumulatedPastExexcutionTimeSeconds holds the total time, in seconds, the workload spent
Expand Down Expand Up @@ -563,7 +563,7 @@ type AdmissionCheckState struct {
// podSetUpdates contains a list of pod set modifications suggested by AdmissionChecks.
// +optional
// +listType=atomic
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
PodSetUpdates []PodSetUpdate `json:"podSetUpdates,omitempty"`
}

Expand Down
14 changes: 7 additions & 7 deletions apis/kueue/v1beta2/workload_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
type WorkloadSpec struct {
// podSets is a list of sets of homogeneous pods, each described by a Pod spec
// and a count.
// There must be at least one element and at most 8.
// There must be at least one element and at most 10.
// podSets cannot be changed.
//
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
// +kubebuilder:validation:MinItems=1
// +optional
PodSets []PodSet `json:"podSets"`
Expand Down Expand Up @@ -272,7 +272,7 @@ type Admission struct {
// podSetAssignments hold the admission results for each of the .spec.podSets entries.
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
// +optional
PodSetAssignments []PodSetAssignment `json:"podSetAssignments"`
}
Expand Down Expand Up @@ -495,7 +495,7 @@ type TopologyAssignmentSlice struct {
PodCounts TopologyAssignmentSlicePodCounts `json:"podCounts,omitempty"`
}

// +kubebuilder:validation:ExactlyOneOf=universal;individual
// +kubebuilder:validation:XValidation:rule="has(self.universal) != has(self.individual)", message="exactly one of the fields in [universal individual] must be set"
type TopologyAssignmentSliceLevelValues struct {
// universal - if set - specifies a single topology placement value (at a particular topology level)
// that applies to all pods in the current TopologyAssignmentSlice.
Expand Down Expand Up @@ -649,7 +649,7 @@ type WorkloadStatus struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
ReclaimablePods []ReclaimablePod `json:"reclaimablePods,omitempty"`

// admissionChecks list all the admission checks required by the workload and the current status
Expand All @@ -669,7 +669,7 @@ type WorkloadStatus struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
ResourceRequests []PodSetRequest `json:"resourceRequests,omitempty"`

// accumulatedPastExecutionTimeSeconds holds the total time, in seconds, the workload spent
Expand Down Expand Up @@ -834,7 +834,7 @@ type AdmissionCheckState struct {
// podSetUpdates contains a list of pod set modifications suggested by AdmissionChecks.
// +optional
// +listType=atomic
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:MaxItems=10
PodSetUpdates []PodSetUpdate `json:"podSetUpdates,omitempty"`
}

Expand Down
26 changes: 13 additions & 13 deletions charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
description: |-
podSets is a list of sets of homogeneous pods, each described by a Pod spec
and a count.
There must be at least one element and at most 8.
There must be at least one element and at most 10.
podSets cannot be changed.
items:
properties:
Expand Down Expand Up @@ -8346,7 +8346,7 @@ spec:
x-kubernetes-validations:
- message: minCount should be positive and less or equal to count
rule: 'has(self.minCount) ? self.minCount <= self.count : true'
maxItems: 8
maxItems: 10
minItems: 1
type: array
x-kubernetes-list-map-keys:
Expand Down Expand Up @@ -8561,7 +8561,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -8674,7 +8674,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-type: atomic
requeueAfterSeconds:
Expand Down Expand Up @@ -8826,7 +8826,7 @@ spec:
- count
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -8882,7 +8882,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -9028,7 +9028,7 @@ spec:
description: |-
podSets is a list of sets of homogeneous pods, each described by a Pod spec
and a count.
There must be at least one element and at most 8.
There must be at least one element and at most 10.
podSets cannot be changed.
items:
properties:
Expand Down Expand Up @@ -17283,7 +17283,7 @@ spec:
x-kubernetes-validations:
- message: minCount should be positive and less or equal to count
rule: 'has(self.minCount) ? self.minCount <= self.count : true'
maxItems: 8
maxItems: 10
minItems: 1
type: array
x-kubernetes-list-map-keys:
Expand Down Expand Up @@ -17545,7 +17545,7 @@ spec:
type: object
x-kubernetes-validations:
- message: exactly one of the fields in [universal individual] must be set
rule: '[has(self.universal),has(self.individual)].filter(x,x==true).size() == 1'
rule: has(self.universal) != has(self.individual)
maxItems: 16
minItems: 1
type: array
Expand All @@ -17571,7 +17571,7 @@ spec:
- message: valuesPerLevel must have the same length as the number of levels in this TopologyAssignment
rule: self.slices.all(x, size(x.valuesPerLevel) == size(self.levels))
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -17683,7 +17683,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-type: atomic
requeueAfterSeconds:
Expand Down Expand Up @@ -17870,7 +17870,7 @@ spec:
- count
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -17926,7 +17926,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down
2 changes: 1 addition & 1 deletion client-go/applyconfiguration/kueue/v1beta1/workloadspec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-go/applyconfiguration/kueue/v1beta2/workloadspec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 13 additions & 14 deletions config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
description: |-
podSets is a list of sets of homogeneous pods, each described by a Pod spec
and a count.
There must be at least one element and at most 8.
There must be at least one element and at most 10.
podSets cannot be changed.
items:
properties:
Expand Down Expand Up @@ -8797,7 +8797,7 @@ spec:
x-kubernetes-validations:
- message: minCount should be positive and less or equal to count
rule: 'has(self.minCount) ? self.minCount <= self.count : true'
maxItems: 8
maxItems: 10
minItems: 1
type: array
x-kubernetes-list-map-keys:
Expand Down Expand Up @@ -9017,7 +9017,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -9142,7 +9142,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-type: atomic
requeueAfterSeconds:
Expand Down Expand Up @@ -9297,7 +9297,7 @@ spec:
- count
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -9354,7 +9354,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -9527,7 +9527,7 @@ spec:
description: |-
podSets is a list of sets of homogeneous pods, each described by a Pod spec
and a count.
There must be at least one element and at most 8.
There must be at least one element and at most 10.
podSets cannot be changed.
items:
properties:
Expand Down Expand Up @@ -18277,7 +18277,7 @@ spec:
x-kubernetes-validations:
- message: minCount should be positive and less or equal to count
rule: 'has(self.minCount) ? self.minCount <= self.count : true'
maxItems: 8
maxItems: 10
minItems: 1
type: array
x-kubernetes-list-map-keys:
Expand Down Expand Up @@ -18620,8 +18620,7 @@ spec:
x-kubernetes-validations:
- message: exactly one of the fields in [universal
individual] must be set
rule: '[has(self.universal),has(self.individual)].filter(x,x==true).size()
== 1'
rule: has(self.universal) != has(self.individual)
maxItems: 16
minItems: 1
type: array
Expand Down Expand Up @@ -18653,7 +18652,7 @@ spec:
number of levels in this TopologyAssignment
rule: self.slices.all(x, size(x.valuesPerLevel) == size(self.levels))
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -18777,7 +18776,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-type: atomic
requeueAfterSeconds:
Expand Down Expand Up @@ -18968,7 +18967,7 @@ spec:
- count
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down Expand Up @@ -19025,7 +19024,7 @@ spec:
required:
- name
type: object
maxItems: 8
maxItems: 10
type: array
x-kubernetes-list-map-keys:
- name
Expand Down
22 changes: 22 additions & 0 deletions pkg/controller/jobframework/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright 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.
*/

package jobframework

const (
// MaxPodSets is the maximum number of PodSets allowed in a Workload.
MaxPodSets = 10
)
Loading