Skip to content

Commit d1f4cfc

Browse files
DROP: Expose available ResourceFlavors from the ClusterQueue in the LocalQueue status.
Commit to be dropped later. Taken from PR: kubernetes-sigs#3143
1 parent ae5f7b2 commit d1f4cfc

File tree

13 files changed

+521
-51
lines changed

13 files changed

+521
-51
lines changed

apis/kueue/v1beta1/localqueue_types.go

+32
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@ type LocalQueueSpec struct {
4848
// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
4949
type ClusterQueueReference string
5050

51+
type LocalQueueFlavorStatus struct {
52+
// name of the flavor.
53+
Name ResourceFlavorReference `json:"name"`
54+
55+
// resources used in the flavor.
56+
// +listType=set
57+
// +kubebuilder:validation:MaxItems=16
58+
// +optional
59+
Resources []corev1.ResourceName `json:"resources,omitempty"`
60+
61+
// nodeLabels are labels that associate the ResourceFlavor with Nodes that
62+
// have the same labels.
63+
// +mapType=atomic
64+
// +kubebuilder:validation:MaxProperties=8
65+
// +optional
66+
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
67+
68+
// nodeTaints are taints that the nodes associated with this ResourceFlavor
69+
// have.
70+
// +listType=atomic
71+
// +kubebuilder:validation:MaxItems=8
72+
// +optional
73+
NodeTaints []corev1.Taint `json:"nodeTaints,omitempty"`
74+
}
75+
5176
// LocalQueueStatus defines the observed state of LocalQueue
5277
type LocalQueueStatus struct {
5378
// PendingWorkloads is the number of Workloads in the LocalQueue not yet admitted to a ClusterQueue
@@ -88,6 +113,13 @@ type LocalQueueStatus struct {
88113
// +kubebuilder:validation:MaxItems=16
89114
// +optional
90115
FlavorUsage []LocalQueueFlavorUsage `json:"flavorUsage"`
116+
117+
// flavors lists all currently available ResourceFlavors in specified ClusterQueue.
118+
// +listType=map
119+
// +listMapKey=name
120+
// +kubebuilder:validation:MaxItems=16
121+
// +optional
122+
Flavors []LocalQueueFlavorStatus `json:"flavors,omitempty"`
91123
}
92124

93125
const (

apis/kueue/v1beta1/zz_generated.deepcopy.go

+41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,78 @@ spec:
226226
x-kubernetes-list-map-keys:
227227
- name
228228
x-kubernetes-list-type: map
229+
flavors:
230+
description: flavors lists all currently available ResourceFlavors
231+
in specified ClusterQueue.
232+
items:
233+
properties:
234+
name:
235+
description: name of the flavor.
236+
maxLength: 253
237+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
238+
type: string
239+
nodeLabels:
240+
additionalProperties:
241+
type: string
242+
description: |-
243+
nodeLabels are labels that associate the ResourceFlavor with Nodes that
244+
have the same labels.
245+
maxProperties: 8
246+
type: object
247+
x-kubernetes-map-type: atomic
248+
nodeTaints:
249+
description: |-
250+
nodeTaints are taints that the nodes associated with this ResourceFlavor
251+
have.
252+
items:
253+
description: |-
254+
The node this Taint is attached to has the "effect" on
255+
any pod that does not tolerate the Taint.
256+
properties:
257+
effect:
258+
description: |-
259+
Required. The effect of the taint on pods
260+
that do not tolerate the taint.
261+
Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
262+
type: string
263+
key:
264+
description: Required. The taint key to be applied to
265+
a node.
266+
type: string
267+
timeAdded:
268+
description: |-
269+
TimeAdded represents the time at which the taint was added.
270+
It is only written for NoExecute taints.
271+
format: date-time
272+
type: string
273+
value:
274+
description: The taint value corresponding to the taint
275+
key.
276+
type: string
277+
required:
278+
- effect
279+
- key
280+
type: object
281+
maxItems: 8
282+
type: array
283+
x-kubernetes-list-type: atomic
284+
resources:
285+
description: resources used in the flavor.
286+
items:
287+
description: ResourceName is the name identifying various
288+
resources in a ResourceList.
289+
type: string
290+
maxItems: 16
291+
type: array
292+
x-kubernetes-list-type: set
293+
required:
294+
- name
295+
type: object
296+
maxItems: 16
297+
type: array
298+
x-kubernetes-list-map-keys:
299+
- name
300+
x-kubernetes-list-type: map
229301
flavorsReservation:
230302
description: |-
231303
flavorsReservation are the reserved quotas, by flavor currently in use by the

client-go/applyconfiguration/kueue/v1beta1/localqueueflavorstatus.go

+80
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go

+20-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/utils.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,78 @@ spec:
211211
x-kubernetes-list-map-keys:
212212
- name
213213
x-kubernetes-list-type: map
214+
flavors:
215+
description: flavors lists all currently available ResourceFlavors
216+
in specified ClusterQueue.
217+
items:
218+
properties:
219+
name:
220+
description: name of the flavor.
221+
maxLength: 253
222+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
223+
type: string
224+
nodeLabels:
225+
additionalProperties:
226+
type: string
227+
description: |-
228+
nodeLabels are labels that associate the ResourceFlavor with Nodes that
229+
have the same labels.
230+
maxProperties: 8
231+
type: object
232+
x-kubernetes-map-type: atomic
233+
nodeTaints:
234+
description: |-
235+
nodeTaints are taints that the nodes associated with this ResourceFlavor
236+
have.
237+
items:
238+
description: |-
239+
The node this Taint is attached to has the "effect" on
240+
any pod that does not tolerate the Taint.
241+
properties:
242+
effect:
243+
description: |-
244+
Required. The effect of the taint on pods
245+
that do not tolerate the taint.
246+
Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
247+
type: string
248+
key:
249+
description: Required. The taint key to be applied to
250+
a node.
251+
type: string
252+
timeAdded:
253+
description: |-
254+
TimeAdded represents the time at which the taint was added.
255+
It is only written for NoExecute taints.
256+
format: date-time
257+
type: string
258+
value:
259+
description: The taint value corresponding to the taint
260+
key.
261+
type: string
262+
required:
263+
- effect
264+
- key
265+
type: object
266+
maxItems: 8
267+
type: array
268+
x-kubernetes-list-type: atomic
269+
resources:
270+
description: resources used in the flavor.
271+
items:
272+
description: ResourceName is the name identifying various
273+
resources in a ResourceList.
274+
type: string
275+
maxItems: 16
276+
type: array
277+
x-kubernetes-list-type: set
278+
required:
279+
- name
280+
type: object
281+
maxItems: 16
282+
type: array
283+
x-kubernetes-list-map-keys:
284+
- name
285+
x-kubernetes-list-type: map
214286
flavorsReservation:
215287
description: |-
216288
flavorsReservation are the reserved quotas, by flavor currently in use by the

0 commit comments

Comments
 (0)