Skip to content

Commit

Permalink
DROP: Expose available ResourceFlavors from the ClusterQueue in the L…
Browse files Browse the repository at this point in the history
…ocalQueue status.

Commit to be dropped later. Taken from PR: kubernetes-sigs#3143
  • Loading branch information
varshaprasad96 authored and openshift-merge-bot[bot] committed Oct 16, 2024
1 parent ae5f7b2 commit d1f4cfc
Show file tree
Hide file tree
Showing 13 changed files with 521 additions and 51 deletions.
32 changes: 32 additions & 0 deletions apis/kueue/v1beta1/localqueue_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ 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.
Name ResourceFlavorReference `json:"name"`

// 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 +113,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 @@ -226,6 +226,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 @@ -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
Loading

0 comments on commit d1f4cfc

Please sign in to comment.