Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose available ResourceFlavors from the ClusterQueue in the LocalQueue status. #3143

Merged
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
34 changes: 34 additions & 0 deletions apis/kueue/v1beta1/localqueue_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,33 @@ type LocalQueueSpec struct {
// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
type ClusterQueueReference string

type LocalQueueFlavorStatus struct {
// name of the flavor.
// +required
// +kubebuilder:validation:Required
Name ResourceFlavorReference `json:"name"`
mbobrovskyi marked this conversation as resolved.
Show resolved Hide resolved

// resources used in the flavor.
// +listType=set
// +kubebuilder:validation:MaxItems=16
// +optional
Resources []corev1.ResourceName `json:"resources,omitempty"`

// nodeLabels are labels that associate the ResourceFlavor with Nodes that
// have the same labels.
// +mapType=atomic
// +kubebuilder:validation:MaxProperties=8
// +optional
NodeLabels map[string]string `json:"nodeLabels,omitempty"`

// nodeTaints are taints that the nodes associated with this ResourceFlavor
// have.
// +listType=atomic
// +kubebuilder:validation:MaxItems=8
// +optional
NodeTaints []corev1.Taint `json:"nodeTaints,omitempty"`
}

// LocalQueueStatus defines the observed state of LocalQueue
type LocalQueueStatus struct {
// PendingWorkloads is the number of Workloads in the LocalQueue not yet admitted to a ClusterQueue
Expand Down Expand Up @@ -88,6 +115,13 @@ type LocalQueueStatus struct {
// +kubebuilder:validation:MaxItems=16
// +optional
FlavorUsage []LocalQueueFlavorUsage `json:"flavorUsage"`

// flavors lists all currently available ResourceFlavors in specified ClusterQueue.
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=16
// +optional
Flavors []LocalQueueFlavorStatus `json:"flavors,omitempty"`
}

const (
Expand Down
41 changes: 41 additions & 0 deletions apis/kueue/v1beta1/zz_generated.deepcopy.go

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

72 changes: 72 additions & 0 deletions charts/kueue/templates/crd/kueue.x-k8s.io_localqueues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,78 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
flavors:
description: flavors lists all currently available ResourceFlavors
in specified ClusterQueue.
items:
properties:
name:
description: name of the flavor.
maxLength: 253
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
nodeLabels:
additionalProperties:
type: string
description: |-
nodeLabels are labels that associate the ResourceFlavor with Nodes that
have the same labels.
maxProperties: 8
type: object
x-kubernetes-map-type: atomic
nodeTaints:
description: |-
nodeTaints are taints that the nodes associated with this ResourceFlavor
have.
items:
description: |-
The node this Taint is attached to has the "effect" on
any pod that does not tolerate the Taint.
properties:
effect:
description: |-
Required. The effect of the taint on pods
that do not tolerate the taint.
Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: Required. The taint key to be applied to
a node.
type: string
timeAdded:
description: |-
TimeAdded represents the time at which the taint was added.
It is only written for NoExecute taints.
format: date-time
type: string
value:
description: The taint value corresponding to the taint
key.
type: string
required:
- effect
- key
type: object
maxItems: 8
type: array
x-kubernetes-list-type: atomic
resources:
description: resources used in the flavor.
items:
description: ResourceName is the name identifying various
resources in a ResourceList.
type: string
maxItems: 16
type: array
x-kubernetes-list-type: set
required:
- name
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
flavorsReservation:
description: |-
flavorsReservation are the reserved quotas, by flavor currently in use by the
Expand Down

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

26 changes: 20 additions & 6 deletions client-go/applyconfiguration/kueue/v1beta1/localqueuestatus.go

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

2 changes: 2 additions & 0 deletions client-go/applyconfiguration/utils.go

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

72 changes: 72 additions & 0 deletions config/components/crd/bases/kueue.x-k8s.io_localqueues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,78 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
flavors:
description: flavors lists all currently available ResourceFlavors
in specified ClusterQueue.
items:
properties:
name:
description: name of the flavor.
maxLength: 253
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
nodeLabels:
additionalProperties:
type: string
description: |-
nodeLabels are labels that associate the ResourceFlavor with Nodes that
have the same labels.
maxProperties: 8
type: object
x-kubernetes-map-type: atomic
nodeTaints:
description: |-
nodeTaints are taints that the nodes associated with this ResourceFlavor
have.
items:
description: |-
The node this Taint is attached to has the "effect" on
any pod that does not tolerate the Taint.
properties:
effect:
description: |-
Required. The effect of the taint on pods
that do not tolerate the taint.
Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: Required. The taint key to be applied to
a node.
type: string
timeAdded:
description: |-
TimeAdded represents the time at which the taint was added.
It is only written for NoExecute taints.
format: date-time
type: string
value:
description: The taint value corresponding to the taint
key.
type: string
required:
- effect
- key
type: object
maxItems: 8
type: array
x-kubernetes-list-type: atomic
resources:
description: resources used in the flavor.
items:
description: ResourceName is the name identifying various
resources in a ResourceList.
type: string
maxItems: 16
type: array
x-kubernetes-list-type: set
required:
- name
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
flavorsReservation:
description: |-
flavorsReservation are the reserved quotas, by flavor currently in use by the
Expand Down
Loading