From b1cd145fb4f6286e4c4af2068bee8a8011b7780f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Wo=C5=BAniak?=
Date: Wed, 16 Oct 2024 19:33:03 +0200
Subject: [PATCH] TAS API (#3235)
---
apis/kueue/v1alpha1/tas_types.go | 87 +++++++
apis/kueue/v1alpha1/zz_generated.deepcopy.go | 109 +++++++++
apis/kueue/v1beta1/resourceflavor_types.go | 7 +
apis/kueue/v1beta1/workload_types.go | 90 +++++++
apis/kueue/v1beta1/zz_generated.deepcopy.go | 87 +++++++
.../crd/kueue.x-k8s.io_resourceflavors.yaml | 6 +
.../crd/kueue.x-k8s.io_topologies.yaml | 91 +++++++
.../crd/kueue.x-k8s.io_workloads.yaml | 91 +++++++
.../kueue/v1alpha1/topology.go | 224 ++++++++++++++++++
.../kueue/v1alpha1/topologylevel.go | 38 +++
.../kueue/v1alpha1/topologyspec.go | 43 ++++
.../kueue/v1beta1/podset.go | 17 +-
.../kueue/v1beta1/podsetassignment.go | 17 +-
.../kueue/v1beta1/podsettopologyrequest.go | 47 ++++
.../kueue/v1beta1/resourceflavorspec.go | 15 +-
.../kueue/v1beta1/topologyassignment.go | 54 +++++
.../kueue/v1beta1/topologydomainassignment.go | 49 ++++
client-go/applyconfiguration/utils.go | 38 ++-
.../kueue/v1alpha1/fake/fake_kueue_client.go | 5 +
.../kueue/v1alpha1/fake/fake_topology.go | 185 +++++++++++++++
.../kueue/v1alpha1/generated_expansion.go | 2 +
.../typed/kueue/v1alpha1/kueue_client.go | 5 +
.../typed/kueue/v1alpha1/topology.go | 72 ++++++
.../informers/externalversions/generic.go | 13 +-
.../externalversions/kueue/interface.go | 8 +
.../kueue/v1alpha1/interface.go | 44 ++++
.../kueue/v1alpha1/topology.go | 88 +++++++
.../kueue/v1alpha1/expansion_generated.go | 22 ++
client-go/listers/kueue/v1alpha1/topology.go | 47 ++++
.../bases/kueue.x-k8s.io_resourceflavors.yaml | 6 +
.../crd/bases/kueue.x-k8s.io_topologies.yaml | 76 ++++++
.../crd/bases/kueue.x-k8s.io_workloads.yaml | 91 +++++++
config/components/crd/kustomization.yaml | 1 +
.../en/docs/reference/kueue-alpha.v1alpha1.md | 105 ++++++++
.../en/docs/reference/kueue.v1beta1.md | 155 ++++++++++++
35 files changed, 2009 insertions(+), 26 deletions(-)
create mode 100644 charts/kueue/templates/crd/kueue.x-k8s.io_topologies.yaml
create mode 100644 client-go/applyconfiguration/kueue/v1alpha1/topology.go
create mode 100644 client-go/applyconfiguration/kueue/v1alpha1/topologylevel.go
create mode 100644 client-go/applyconfiguration/kueue/v1alpha1/topologyspec.go
create mode 100644 client-go/applyconfiguration/kueue/v1beta1/podsettopologyrequest.go
create mode 100644 client-go/applyconfiguration/kueue/v1beta1/topologyassignment.go
create mode 100644 client-go/applyconfiguration/kueue/v1beta1/topologydomainassignment.go
create mode 100644 client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_topology.go
create mode 100644 client-go/clientset/versioned/typed/kueue/v1alpha1/topology.go
create mode 100644 client-go/informers/externalversions/kueue/v1alpha1/interface.go
create mode 100644 client-go/informers/externalversions/kueue/v1alpha1/topology.go
create mode 100644 client-go/listers/kueue/v1alpha1/expansion_generated.go
create mode 100644 client-go/listers/kueue/v1alpha1/topology.go
create mode 100644 config/components/crd/bases/kueue.x-k8s.io_topologies.yaml
diff --git a/apis/kueue/v1alpha1/tas_types.go b/apis/kueue/v1alpha1/tas_types.go
index 0e6aa6ff8f..acb6ae2bdc 100644
--- a/apis/kueue/v1alpha1/tas_types.go
+++ b/apis/kueue/v1alpha1/tas_types.go
@@ -16,7 +16,33 @@ limitations under the License.
package v1alpha1
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
const (
+ // PodSetRequiredTopologyAnnotation indicates that a PodSet requires
+ // Topology Aware Scheduling, and requires scheduling all pods on nodes
+ // within the same topology domain corresponding to the topology level
+ // indicated by the annotation value (e.g. within a rack or within a block).
+ PodSetRequiredTopologyAnnotation = "kueue.x-k8s.io/podset-required-topology"
+
+ // PodSetPreferredTopologyAnnotation indicates that a PodSet requires
+ // Topology Aware Scheduling, but scheduling all pods within pods on nodes
+ // within the same topology domain is a preference rather than requirement.
+ //
+ // The levels are evaluated one-by-one going up from the level indicated by
+ // the annotation. If the PodSet cannot fit within a given topology domain
+ // then the next topology level up is considered. If the PodSet cannot fit
+ // at the highest topology level, then it gets admitted as distributed
+ // among multiple topology domains.
+ PodSetPreferredTopologyAnnotation = "kueue.x-k8s.io/podset-preferred-topology"
+
+ // TopologySchedulingGate is used to delay scheduling of a Pod until the
+ // nodeSelectors corresponding to the assigned topology domain are injected
+ // into the Pod.
+ TopologySchedulingGate = "kueue.x-k8s.io/topology"
+
// WorkloadAnnotation is an annotation set on the Job's PodTemplate to
// indicate the name of the admitted Workload corresponding to the Job. The
// annotation is set when starting the Job, and removed on stopping the Job.
@@ -27,3 +53,64 @@ const (
// The label is set when starting the Job, and removed on stopping the Job.
PodSetLabel = "kueue.x-k8s.io/podset"
)
+
+// TopologySpec defines the desired state of Topology
+type TopologySpec struct {
+ // levels define the levels of topology.
+ //
+ // +required
+ // +listType=atomic
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=8
+ Levels []TopologyLevel `json:"levels,omitempty"`
+}
+
+// TopologyLevel defines the desired state of TopologyLevel
+type TopologyLevel struct {
+ // nodeLabel indicates the name of the node label for a specific topology
+ // level.
+ //
+ // Examples:
+ // - cloud.provider.com/topology-block
+ // - cloud.provider.com/topology-rack
+ //
+ // +required
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=316
+ // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
+ NodeLabel string `json:"nodeLabel"`
+}
+
+// TopologyStatus defines the observed state of Topology
+type TopologyStatus struct {
+}
+
+// +genclient
+// +genclient:nonNamespaced
+// +kubebuilder:object:root=true
+// +kubebuilder:storageversion
+// +kubebuilder:subresource:status
+// +kubebuilder:resource:scope=Cluster
+
+// Topology is the Schema for the topology API
+type Topology struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec TopologySpec `json:"spec,omitempty"`
+ Status TopologyStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// TopologyList contains a list of Topology
+type TopologyList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Topology `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Topology{}, &TopologyList{})
+}
diff --git a/apis/kueue/v1alpha1/zz_generated.deepcopy.go b/apis/kueue/v1alpha1/zz_generated.deepcopy.go
index 2ff1d6db07..4aecfa964a 100644
--- a/apis/kueue/v1alpha1/zz_generated.deepcopy.go
+++ b/apis/kueue/v1alpha1/zz_generated.deepcopy.go
@@ -128,3 +128,112 @@ func (in *CohortStatus) DeepCopy() *CohortStatus {
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Topology) DeepCopyInto(out *Topology) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.
+func (in *Topology) DeepCopy() *Topology {
+ if in == nil {
+ return nil
+ }
+ out := new(Topology)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Topology) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologyLevel) DeepCopyInto(out *TopologyLevel) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyLevel.
+func (in *TopologyLevel) DeepCopy() *TopologyLevel {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologyLevel)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologyList) DeepCopyInto(out *TopologyList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Topology, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyList.
+func (in *TopologyList) DeepCopy() *TopologyList {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologyList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *TopologyList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologySpec) DeepCopyInto(out *TopologySpec) {
+ *out = *in
+ if in.Levels != nil {
+ in, out := &in.Levels, &out.Levels
+ *out = make([]TopologyLevel, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologySpec.
+func (in *TopologySpec) DeepCopy() *TopologySpec {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologySpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologyStatus) DeepCopyInto(out *TopologyStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyStatus.
+func (in *TopologyStatus) DeepCopy() *TopologyStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologyStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/apis/kueue/v1beta1/resourceflavor_types.go b/apis/kueue/v1beta1/resourceflavor_types.go
index f66f1c2e52..3e2c92c501 100644
--- a/apis/kueue/v1beta1/resourceflavor_types.go
+++ b/apis/kueue/v1beta1/resourceflavor_types.go
@@ -85,6 +85,13 @@ type ResourceFlavorSpec struct {
// +kubebuilder:validation:XValidation:rule="self.all(x, has(x.operator) && x.operator == 'Exists' ? !has(x.value) : true)", message="a value must be empty when 'operator' is 'Exists'"
// +kubebuilder:validation:XValidation:rule="self.all(x, !has(x.effect) || x.effect in ['NoSchedule', 'PreferNoSchedule', 'NoExecute'])", message="supported taint effect values: 'NoSchedule', 'PreferNoSchedule', 'NoExecute'"
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
+
+ // topologyName indicates topology for the TAS ResourceFlavor.
+ // When specified, it enables scraping of the topology information from the
+ // nodes matching to the Resource Flavor node labels.
+ //
+ // +optional
+ TopologyName *string `json:"topologyName,omitempty"`
}
// +kubebuilder:object:root=true
diff --git a/apis/kueue/v1beta1/workload_types.go b/apis/kueue/v1beta1/workload_types.go
index 41d40cb4cf..f2d9ece53e 100644
--- a/apis/kueue/v1beta1/workload_types.go
+++ b/apis/kueue/v1beta1/workload_types.go
@@ -77,6 +77,23 @@ type WorkloadSpec struct {
Active *bool `json:"active,omitempty"`
}
+// PodSetTopologyRequest defines the topology request for a PodSet.
+type PodSetTopologyRequest struct {
+ // required indicates the topology level required by the PodSet, as
+ // indicated by the `kueue.x-k8s.io/podset-required-topology` PodSet
+ // annotation.
+ //
+ // +optional
+ Required *string `json:"required,omitempty"`
+
+ // preferred indicates the topology level preferred by the PodSet, as
+ // indicated by the `kueue.x-k8s.io/podset-preferred-topology` PodSet
+ // annotation.
+ //
+ // +optional
+ Preferred *string `json:"preferred,omitempty"`
+}
+
type Admission struct {
// clusterQueue is the name of the ClusterQueue that admitted this workload.
ClusterQueue ClusterQueueReference `json:"clusterQueue"`
@@ -113,6 +130,74 @@ type PodSetAssignment struct {
// +optional
// +kubebuilder:validation:Minimum=0
Count *int32 `json:"count,omitempty"`
+
+ // topologyAssignment indicates the topology assignment divided into
+ // topology domains corresponding to the lowest level of the topology.
+ // The assignment specifies the number of Pods to be scheduled per topology
+ // domain and specifies the node selectors for each topology domain, in the
+ // following way: the node selector keys are specified by the levels field
+ // (same for all domains), and the corresponding node selector value is
+ // specified by the domains.values subfield.
+ //
+ // Example:
+ //
+ // topologyAssignment:
+ // levels:
+ // - cloud.provider.com/topology-block
+ // - cloud.provider.com/topology-rack
+ // domains:
+ // - values: [block-1, rack-1]
+ // count: 4
+ // - values: [block-1, rack-2]
+ // count: 2
+ //
+ // Here:
+ // - 4 Pods are to be scheduled on nodes matching the node selector:
+ // cloud.provider.com/topology-block: block-1
+ // cloud.provider.com/topology-rack: rack-1
+ // - 2 Pods are to be scheduled on nodes matching the node selector:
+ // cloud.provider.com/topology-block: block-1
+ // cloud.provider.com/topology-rack: rack-2
+ //
+ // +optional
+ TopologyAssignment *TopologyAssignment `json:"topologyAssignment,omitempty"`
+}
+
+type TopologyAssignment struct {
+ // levels is an ordered list of keys denoting the levels of the assigned
+ // topology (i.e. node label keys), from the highest to the lowest level of
+ // the topology.
+ //
+ // +required
+ // +listType=atomic
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=8
+ Levels []string `json:"levels"`
+
+ // domains is a list of topology assignments split by topology domains at
+ // the lowest level of the topology.
+ //
+ // +required
+ Domains []TopologyDomainAssignment `json:"domains"`
+}
+
+type TopologyDomainAssignment struct {
+ // values is an ordered list of node selector values describing a topology
+ // domain. The values correspond to the consecutive topology levels, from
+ // the highest to the lowest.
+ //
+ // +required
+ // +listType=atomic
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=8
+ Values []string `json:"values"`
+
+ // count indicates the number of Pods to be scheduled in the topology
+ // domain indicated by the values field.
+ //
+ // +required
+ // +kubebuilder:validation:Minimum=1
+ Count int32 `json:"count"`
}
// +kubebuilder:validation:XValidation:rule="has(self.minCount) ? self.minCount <= self.count : true", message="minCount should be positive and less or equal to count"
@@ -156,6 +241,11 @@ type PodSet struct {
// +optional
// +kubebuilder:validation:Minimum=1
MinCount *int32 `json:"minCount,omitempty"`
+
+ // topologyRequest defines the topology request for the PodSet.
+ //
+ // +optional
+ TopologyRequest *PodSetTopologyRequest `json:"topologyRequest,omitempty"`
}
// WorkloadStatus defines the observed state of Workload
diff --git a/apis/kueue/v1beta1/zz_generated.deepcopy.go b/apis/kueue/v1beta1/zz_generated.deepcopy.go
index 7e57bd0791..3b71aa6b78 100644
--- a/apis/kueue/v1beta1/zz_generated.deepcopy.go
+++ b/apis/kueue/v1beta1/zz_generated.deepcopy.go
@@ -918,6 +918,11 @@ func (in *PodSet) DeepCopyInto(out *PodSet) {
*out = new(int32)
**out = **in
}
+ if in.TopologyRequest != nil {
+ in, out := &in.TopologyRequest, &out.TopologyRequest
+ *out = new(PodSetTopologyRequest)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSet.
@@ -952,6 +957,11 @@ func (in *PodSetAssignment) DeepCopyInto(out *PodSetAssignment) {
*out = new(int32)
**out = **in
}
+ if in.TopologyAssignment != nil {
+ in, out := &in.TopologyAssignment, &out.TopologyAssignment
+ *out = new(TopologyAssignment)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSetAssignment.
@@ -964,6 +974,31 @@ func (in *PodSetAssignment) DeepCopy() *PodSetAssignment {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PodSetTopologyRequest) DeepCopyInto(out *PodSetTopologyRequest) {
+ *out = *in
+ if in.Required != nil {
+ in, out := &in.Required, &out.Required
+ *out = new(string)
+ **out = **in
+ }
+ if in.Preferred != nil {
+ in, out := &in.Preferred, &out.Preferred
+ *out = new(string)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSetTopologyRequest.
+func (in *PodSetTopologyRequest) DeepCopy() *PodSetTopologyRequest {
+ if in == nil {
+ return nil
+ }
+ out := new(PodSetTopologyRequest)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSetUpdate) DeepCopyInto(out *PodSetUpdate) {
*out = *in
@@ -1213,6 +1248,11 @@ func (in *ResourceFlavorSpec) DeepCopyInto(out *ResourceFlavorSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.TopologyName != nil {
+ in, out := &in.TopologyName, &out.TopologyName
+ *out = new(string)
+ **out = **in
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFlavorSpec.
@@ -1295,6 +1335,53 @@ func (in *ResourceUsage) DeepCopy() *ResourceUsage {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologyAssignment) DeepCopyInto(out *TopologyAssignment) {
+ *out = *in
+ if in.Levels != nil {
+ in, out := &in.Levels, &out.Levels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Domains != nil {
+ in, out := &in.Domains, &out.Domains
+ *out = make([]TopologyDomainAssignment, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyAssignment.
+func (in *TopologyAssignment) DeepCopy() *TopologyAssignment {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologyAssignment)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TopologyDomainAssignment) DeepCopyInto(out *TopologyDomainAssignment) {
+ *out = *in
+ if in.Values != nil {
+ in, out := &in.Values, &out.Values
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyDomainAssignment.
+func (in *TopologyDomainAssignment) DeepCopy() *TopologyDomainAssignment {
+ if in == nil {
+ return nil
+ }
+ out := new(TopologyDomainAssignment)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Workload) DeepCopyInto(out *Workload) {
*out = *in
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
index 185c677a12..507d52b9b7 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_resourceflavors.yaml
@@ -186,6 +186,12 @@ spec:
''NoExecute'''
rule: self.all(x, !has(x.effect) || x.effect in ['NoSchedule', 'PreferNoSchedule',
'NoExecute'])
+ topologyName:
+ description: |-
+ topologyName indicates topology for the TAS ResourceFlavor.
+ When specified, it enables scraping of the topology information from the
+ nodes matching to the Resource Flavor node labels.
+ type: string
type: object
type: object
served: true
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_topologies.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_topologies.yaml
new file mode 100644
index 0000000000..efdf2f9c00
--- /dev/null
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_topologies.yaml
@@ -0,0 +1,91 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ labels:
+ {{- include "kueue.labels" . | nindent 4 }}
+ annotations:
+ {{- if .Values.enableCertManager }}
+ cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "kueue.fullname" . }}-serving-cert
+ {{- end }}
+ controller-gen.kubebuilder.io/version: v0.16.4
+ name: topologies.kueue.x-k8s.io
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ name: {{ include "kueue.fullname" . }}-webhook-service
+ namespace: '{{ .Release.Namespace }}'
+ path: /convert
+ conversionReviewVersions:
+ - v1
+ group: kueue.x-k8s.io
+ names:
+ kind: Topology
+ listKind: TopologyList
+ plural: topologies
+ singular: topology
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ description: Topology is the Schema for the topology API
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: TopologySpec defines the desired state of Topology
+ properties:
+ levels:
+ description: levels define the levels of topology.
+ items:
+ description: TopologyLevel defines the desired state of TopologyLevel
+ properties:
+ nodeLabel:
+ description: |-
+ nodeLabel indicates the name of the node label for a specific topology
+ level.
+
+ Examples:
+ - cloud.provider.com/topology-block
+ - cloud.provider.com/topology-rack
+ maxLength: 316
+ minLength: 1
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - nodeLabel
+ type: object
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - levels
+ type: object
+ status:
+ description: TopologyStatus defines the observed state of Topology
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml b/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
index 6f38665ff6..8af27dad75 100644
--- a/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
+++ b/charts/kueue/templates/crd/kueue.x-k8s.io_workloads.yaml
@@ -8183,6 +8183,23 @@ spec:
- containers
type: object
type: object
+ topologyRequest:
+ description: topologyRequest defines the topology request for
+ the PodSet.
+ properties:
+ preferred:
+ description: |-
+ preferred indicates the topology level preferred by the PodSet, as
+ indicated by the `kueue.x-k8s.io/podset-preferred-topology` PodSet
+ annotation.
+ type: string
+ required:
+ description: |-
+ required indicates the topology level required by the PodSet, as
+ indicated by the `kueue.x-k8s.io/podset-required-topology` PodSet
+ annotation.
+ type: string
+ type: object
required:
- count
- template
@@ -8300,6 +8317,80 @@ spec:
the LimitRange defaults and RuntimeClass overheads at the moment of admission.
This field will not change in case of quota reclaim.
type: object
+ topologyAssignment:
+ description: |-
+ topologyAssignment indicates the topology assignment divided into
+ topology domains corresponding to the lowest level of the topology.
+ The assignment specifies the number of Pods to be scheduled per topology
+ domain and specifies the node selectors for each topology domain, in the
+ following way: the node selector keys are specified by the levels field
+ (same for all domains), and the corresponding node selector value is
+ specified by the domains.values subfield.
+
+ Example:
+
+ topologyAssignment:
+ levels:
+ - cloud.provider.com/topology-block
+ - cloud.provider.com/topology-rack
+ domains:
+ - values: [block-1, rack-1]
+ count: 4
+ - values: [block-1, rack-2]
+ count: 2
+
+ Here:
+ - 4 Pods are to be scheduled on nodes matching the node selector:
+ cloud.provider.com/topology-block: block-1
+ cloud.provider.com/topology-rack: rack-1
+ - 2 Pods are to be scheduled on nodes matching the node selector:
+ cloud.provider.com/topology-block: block-1
+ cloud.provider.com/topology-rack: rack-2
+ properties:
+ domains:
+ description: |-
+ domains is a list of topology assignments split by topology domains at
+ the lowest level of the topology.
+ items:
+ properties:
+ count:
+ description: |-
+ count indicates the number of Pods to be scheduled in the topology
+ domain indicated by the values field.
+ format: int32
+ minimum: 1
+ type: integer
+ values:
+ description: |-
+ values is an ordered list of node selector values describing a topology
+ domain. The values correspond to the consecutive topology levels, from
+ the highest to the lowest.
+ items:
+ type: string
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - count
+ - values
+ type: object
+ type: array
+ levels:
+ description: |-
+ levels is an ordered list of keys denoting the levels of the assigned
+ topology (i.e. node label keys), from the highest to the lowest level of
+ the topology.
+ items:
+ type: string
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - domains
+ - levels
+ type: object
required:
- name
type: object
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/topology.go b/client-go/applyconfiguration/kueue/v1alpha1/topology.go
new file mode 100644
index 0000000000..ad0b01ded5
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1alpha1/topology.go
@@ -0,0 +1,224 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+ kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+)
+
+// TopologyApplyConfiguration represents a declarative configuration of the Topology type for use
+// with apply.
+type TopologyApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *TopologySpecApplyConfiguration `json:"spec,omitempty"`
+ Status *kueuev1alpha1.TopologyStatus `json:"status,omitempty"`
+}
+
+// Topology constructs a declarative configuration of the Topology type for use with
+// apply.
+func Topology(name string) *TopologyApplyConfiguration {
+ b := &TopologyApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Topology")
+ b.WithAPIVersion("kueue.x-k8s.io/v1alpha1")
+ return b
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithKind(value string) *TopologyApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithAPIVersion(value string) *TopologyApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithName(value string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithGenerateName(value string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithNamespace(value string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithUID(value types.UID) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithResourceVersion(value string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithGeneration(value int64) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *TopologyApplyConfiguration) WithLabels(entries map[string]string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *TopologyApplyConfiguration) WithAnnotations(entries map[string]string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *TopologyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *TopologyApplyConfiguration) WithFinalizers(values ...string) *TopologyApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *TopologyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithSpec(value *TopologySpecApplyConfiguration) *TopologyApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *TopologyApplyConfiguration) WithStatus(value kueuev1alpha1.TopologyStatus) *TopologyApplyConfiguration {
+ b.Status = &value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *TopologyApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/topologylevel.go b/client-go/applyconfiguration/kueue/v1alpha1/topologylevel.go
new file mode 100644
index 0000000000..00f627b676
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1alpha1/topologylevel.go
@@ -0,0 +1,38 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// TopologyLevelApplyConfiguration represents a declarative configuration of the TopologyLevel type for use
+// with apply.
+type TopologyLevelApplyConfiguration struct {
+ NodeLabel *string `json:"nodeLabel,omitempty"`
+}
+
+// TopologyLevelApplyConfiguration constructs a declarative configuration of the TopologyLevel type for use with
+// apply.
+func TopologyLevel() *TopologyLevelApplyConfiguration {
+ return &TopologyLevelApplyConfiguration{}
+}
+
+// WithNodeLabel sets the NodeLabel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodeLabel field is set to the value of the last call.
+func (b *TopologyLevelApplyConfiguration) WithNodeLabel(value string) *TopologyLevelApplyConfiguration {
+ b.NodeLabel = &value
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1alpha1/topologyspec.go b/client-go/applyconfiguration/kueue/v1alpha1/topologyspec.go
new file mode 100644
index 0000000000..c2a1c1cfdd
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1alpha1/topologyspec.go
@@ -0,0 +1,43 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// TopologySpecApplyConfiguration represents a declarative configuration of the TopologySpec type for use
+// with apply.
+type TopologySpecApplyConfiguration struct {
+ Levels []TopologyLevelApplyConfiguration `json:"levels,omitempty"`
+}
+
+// TopologySpecApplyConfiguration constructs a declarative configuration of the TopologySpec type for use with
+// apply.
+func TopologySpec() *TopologySpecApplyConfiguration {
+ return &TopologySpecApplyConfiguration{}
+}
+
+// WithLevels adds the given value to the Levels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Levels field.
+func (b *TopologySpecApplyConfiguration) WithLevels(values ...*TopologyLevelApplyConfiguration) *TopologySpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithLevels")
+ }
+ b.Levels = append(b.Levels, *values[i])
+ }
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podset.go b/client-go/applyconfiguration/kueue/v1beta1/podset.go
index fc2d1996f4..4d6738c0a1 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/podset.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/podset.go
@@ -24,10 +24,11 @@ import (
// PodSetApplyConfiguration represents a declarative configuration of the PodSet type for use
// with apply.
type PodSetApplyConfiguration struct {
- Name *string `json:"name,omitempty"`
- Template *v1.PodTemplateSpec `json:"template,omitempty"`
- Count *int32 `json:"count,omitempty"`
- MinCount *int32 `json:"minCount,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Template *v1.PodTemplateSpec `json:"template,omitempty"`
+ Count *int32 `json:"count,omitempty"`
+ MinCount *int32 `json:"minCount,omitempty"`
+ TopologyRequest *PodSetTopologyRequestApplyConfiguration `json:"topologyRequest,omitempty"`
}
// PodSetApplyConfiguration constructs a declarative configuration of the PodSet type for use with
@@ -67,3 +68,11 @@ func (b *PodSetApplyConfiguration) WithMinCount(value int32) *PodSetApplyConfigu
b.MinCount = &value
return b
}
+
+// WithTopologyRequest sets the TopologyRequest field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TopologyRequest field is set to the value of the last call.
+func (b *PodSetApplyConfiguration) WithTopologyRequest(value *PodSetTopologyRequestApplyConfiguration) *PodSetApplyConfiguration {
+ b.TopologyRequest = value
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go b/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
index d69bdf4b74..bfc8418d0f 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.go
@@ -25,10 +25,11 @@ import (
// PodSetAssignmentApplyConfiguration represents a declarative configuration of the PodSetAssignment type for use
// with apply.
type PodSetAssignmentApplyConfiguration struct {
- Name *string `json:"name,omitempty"`
- Flavors map[v1.ResourceName]v1beta1.ResourceFlavorReference `json:"flavors,omitempty"`
- ResourceUsage *v1.ResourceList `json:"resourceUsage,omitempty"`
- Count *int32 `json:"count,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Flavors map[v1.ResourceName]v1beta1.ResourceFlavorReference `json:"flavors,omitempty"`
+ ResourceUsage *v1.ResourceList `json:"resourceUsage,omitempty"`
+ Count *int32 `json:"count,omitempty"`
+ TopologyAssignment *TopologyAssignmentApplyConfiguration `json:"topologyAssignment,omitempty"`
}
// PodSetAssignmentApplyConfiguration constructs a declarative configuration of the PodSetAssignment type for use with
@@ -74,3 +75,11 @@ func (b *PodSetAssignmentApplyConfiguration) WithCount(value int32) *PodSetAssig
b.Count = &value
return b
}
+
+// WithTopologyAssignment sets the TopologyAssignment field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TopologyAssignment field is set to the value of the last call.
+func (b *PodSetAssignmentApplyConfiguration) WithTopologyAssignment(value *TopologyAssignmentApplyConfiguration) *PodSetAssignmentApplyConfiguration {
+ b.TopologyAssignment = value
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/podsettopologyrequest.go b/client-go/applyconfiguration/kueue/v1beta1/podsettopologyrequest.go
new file mode 100644
index 0000000000..84d6e444f6
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1beta1/podsettopologyrequest.go
@@ -0,0 +1,47 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// PodSetTopologyRequestApplyConfiguration represents a declarative configuration of the PodSetTopologyRequest type for use
+// with apply.
+type PodSetTopologyRequestApplyConfiguration struct {
+ Required *string `json:"required,omitempty"`
+ Preferred *string `json:"preferred,omitempty"`
+}
+
+// PodSetTopologyRequestApplyConfiguration constructs a declarative configuration of the PodSetTopologyRequest type for use with
+// apply.
+func PodSetTopologyRequest() *PodSetTopologyRequestApplyConfiguration {
+ return &PodSetTopologyRequestApplyConfiguration{}
+}
+
+// WithRequired sets the Required field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Required field is set to the value of the last call.
+func (b *PodSetTopologyRequestApplyConfiguration) WithRequired(value string) *PodSetTopologyRequestApplyConfiguration {
+ b.Required = &value
+ return b
+}
+
+// WithPreferred sets the Preferred field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Preferred field is set to the value of the last call.
+func (b *PodSetTopologyRequestApplyConfiguration) WithPreferred(value string) *PodSetTopologyRequestApplyConfiguration {
+ b.Preferred = &value
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go b/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
index 2c4f8d6bc5..8cca781d88 100644
--- a/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
+++ b/client-go/applyconfiguration/kueue/v1beta1/resourceflavorspec.go
@@ -24,9 +24,10 @@ import (
// ResourceFlavorSpecApplyConfiguration represents a declarative configuration of the ResourceFlavorSpec type for use
// with apply.
type ResourceFlavorSpecApplyConfiguration struct {
- NodeLabels map[string]string `json:"nodeLabels,omitempty"`
- NodeTaints []v1.Taint `json:"nodeTaints,omitempty"`
- Tolerations []v1.Toleration `json:"tolerations,omitempty"`
+ NodeLabels map[string]string `json:"nodeLabels,omitempty"`
+ NodeTaints []v1.Taint `json:"nodeTaints,omitempty"`
+ Tolerations []v1.Toleration `json:"tolerations,omitempty"`
+ TopologyName *string `json:"topologyName,omitempty"`
}
// ResourceFlavorSpecApplyConfiguration constructs a declarative configuration of the ResourceFlavorSpec type for use with
@@ -68,3 +69,11 @@ func (b *ResourceFlavorSpecApplyConfiguration) WithTolerations(values ...v1.Tole
}
return b
}
+
+// WithTopologyName sets the TopologyName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TopologyName field is set to the value of the last call.
+func (b *ResourceFlavorSpecApplyConfiguration) WithTopologyName(value string) *ResourceFlavorSpecApplyConfiguration {
+ b.TopologyName = &value
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/topologyassignment.go b/client-go/applyconfiguration/kueue/v1beta1/topologyassignment.go
new file mode 100644
index 0000000000..2c4df04962
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1beta1/topologyassignment.go
@@ -0,0 +1,54 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// TopologyAssignmentApplyConfiguration represents a declarative configuration of the TopologyAssignment type for use
+// with apply.
+type TopologyAssignmentApplyConfiguration struct {
+ Levels []string `json:"levels,omitempty"`
+ Domains []TopologyDomainAssignmentApplyConfiguration `json:"domains,omitempty"`
+}
+
+// TopologyAssignmentApplyConfiguration constructs a declarative configuration of the TopologyAssignment type for use with
+// apply.
+func TopologyAssignment() *TopologyAssignmentApplyConfiguration {
+ return &TopologyAssignmentApplyConfiguration{}
+}
+
+// WithLevels adds the given value to the Levels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Levels field.
+func (b *TopologyAssignmentApplyConfiguration) WithLevels(values ...string) *TopologyAssignmentApplyConfiguration {
+ for i := range values {
+ b.Levels = append(b.Levels, values[i])
+ }
+ return b
+}
+
+// WithDomains adds the given value to the Domains field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Domains field.
+func (b *TopologyAssignmentApplyConfiguration) WithDomains(values ...*TopologyDomainAssignmentApplyConfiguration) *TopologyAssignmentApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithDomains")
+ }
+ b.Domains = append(b.Domains, *values[i])
+ }
+ return b
+}
diff --git a/client-go/applyconfiguration/kueue/v1beta1/topologydomainassignment.go b/client-go/applyconfiguration/kueue/v1beta1/topologydomainassignment.go
new file mode 100644
index 0000000000..705b5274ed
--- /dev/null
+++ b/client-go/applyconfiguration/kueue/v1beta1/topologydomainassignment.go
@@ -0,0 +1,49 @@
+/*
+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.
+*/
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1beta1
+
+// TopologyDomainAssignmentApplyConfiguration represents a declarative configuration of the TopologyDomainAssignment type for use
+// with apply.
+type TopologyDomainAssignmentApplyConfiguration struct {
+ Values []string `json:"values,omitempty"`
+ Count *int32 `json:"count,omitempty"`
+}
+
+// TopologyDomainAssignmentApplyConfiguration constructs a declarative configuration of the TopologyDomainAssignment type for use with
+// apply.
+func TopologyDomainAssignment() *TopologyDomainAssignmentApplyConfiguration {
+ return &TopologyDomainAssignmentApplyConfiguration{}
+}
+
+// WithValues adds the given value to the Values field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Values field.
+func (b *TopologyDomainAssignmentApplyConfiguration) WithValues(values ...string) *TopologyDomainAssignmentApplyConfiguration {
+ for i := range values {
+ b.Values = append(b.Values, values[i])
+ }
+ return b
+}
+
+// WithCount sets the Count field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Count field is set to the value of the last call.
+func (b *TopologyDomainAssignmentApplyConfiguration) WithCount(value int32) *TopologyDomainAssignmentApplyConfiguration {
+ b.Count = &value
+ return b
+}
diff --git a/client-go/applyconfiguration/utils.go b/client-go/applyconfiguration/utils.go
index f6fb98da9f..03bbba6353 100644
--- a/client-go/applyconfiguration/utils.go
+++ b/client-go/applyconfiguration/utils.go
@@ -21,12 +21,14 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
testing "k8s.io/client-go/testing"
+ v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
internal "sigs.k8s.io/kueue/client-go/applyconfiguration/internal"
+ kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
kueuev1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
- visibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
+ applyconfigurationvisibilityv1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1alpha1"
applyconfigurationvisibilityv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/visibility/v1beta1"
)
@@ -34,7 +36,15 @@ import (
// apply configuration type exists for the given GroupVersionKind.
func ForKind(kind schema.GroupVersionKind) interface{} {
switch kind {
- // Group=kueue.x-k8s.io, Version=v1beta1
+ // Group=kueue.x-k8s.io, Version=v1alpha1
+ case v1alpha1.SchemeGroupVersion.WithKind("Topology"):
+ return &kueuev1alpha1.TopologyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("TopologyLevel"):
+ return &kueuev1alpha1.TopologyLevelApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("TopologySpec"):
+ return &kueuev1alpha1.TopologySpecApplyConfiguration{}
+
+ // Group=kueue.x-k8s.io, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithKind("Admission"):
return &kueuev1beta1.AdmissionApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("AdmissionCheck"):
@@ -101,6 +111,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.PodSetApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodSetAssignment"):
return &kueuev1beta1.PodSetAssignmentApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("PodSetTopologyRequest"):
+ return &kueuev1beta1.PodSetTopologyRequestApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodSetUpdate"):
return &kueuev1beta1.PodSetUpdateApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("ProvisioningRequestConfig"):
@@ -121,6 +133,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.ResourceQuotaApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("ResourceUsage"):
return &kueuev1beta1.ResourceUsageApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("TopologyAssignment"):
+ return &kueuev1beta1.TopologyAssignmentApplyConfiguration{}
+ case v1beta1.SchemeGroupVersion.WithKind("TopologyDomainAssignment"):
+ return &kueuev1beta1.TopologyDomainAssignmentApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("Workload"):
return &kueuev1beta1.WorkloadApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("WorkloadPriorityClass"):
@@ -131,14 +147,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &kueuev1beta1.WorkloadStatusApplyConfiguration{}
// Group=visibility.kueue.x-k8s.io, Version=v1alpha1
- case v1alpha1.SchemeGroupVersion.WithKind("ClusterQueue"):
- return &visibilityv1alpha1.ClusterQueueApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("LocalQueue"):
- return &visibilityv1alpha1.LocalQueueApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("PendingWorkload"):
- return &visibilityv1alpha1.PendingWorkloadApplyConfiguration{}
- case v1alpha1.SchemeGroupVersion.WithKind("PendingWorkloadsSummary"):
- return &visibilityv1alpha1.PendingWorkloadsSummaryApplyConfiguration{}
+ case visibilityv1alpha1.SchemeGroupVersion.WithKind("ClusterQueue"):
+ return &applyconfigurationvisibilityv1alpha1.ClusterQueueApplyConfiguration{}
+ case visibilityv1alpha1.SchemeGroupVersion.WithKind("LocalQueue"):
+ return &applyconfigurationvisibilityv1alpha1.LocalQueueApplyConfiguration{}
+ case visibilityv1alpha1.SchemeGroupVersion.WithKind("PendingWorkload"):
+ return &applyconfigurationvisibilityv1alpha1.PendingWorkloadApplyConfiguration{}
+ case visibilityv1alpha1.SchemeGroupVersion.WithKind("PendingWorkloadsSummary"):
+ return &applyconfigurationvisibilityv1alpha1.PendingWorkloadsSummaryApplyConfiguration{}
// Group=visibility.kueue.x-k8s.io, Version=v1beta1
case visibilityv1beta1.SchemeGroupVersion.WithKind("ClusterQueue"):
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
index 68596e950f..232f594cb5 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_kueue_client.go
@@ -20,12 +20,17 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
+ v1alpha1 "sigs.k8s.io/kueue/client-go/clientset/versioned/typed/kueue/v1alpha1"
)
type FakeKueueV1alpha1 struct {
*testing.Fake
}
+func (c *FakeKueueV1alpha1) Topologies() v1alpha1.TopologyInterface {
+ return &FakeTopologies{c}
+}
+
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeKueueV1alpha1) RESTClient() rest.Interface {
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_topology.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_topology.go
new file mode 100644
index 0000000000..231def30b2
--- /dev/null
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/fake/fake_topology.go
@@ -0,0 +1,185 @@
+/*
+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.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+ json "encoding/json"
+ "fmt"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+ v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
+)
+
+// FakeTopologies implements TopologyInterface
+type FakeTopologies struct {
+ Fake *FakeKueueV1alpha1
+}
+
+var topologiesResource = v1alpha1.SchemeGroupVersion.WithResource("topologies")
+
+var topologiesKind = v1alpha1.SchemeGroupVersion.WithKind("Topology")
+
+// Get takes name of the topology, and returns the corresponding topology object, and an error if there is any.
+func (c *FakeTopologies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Topology, err error) {
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootGetActionWithOptions(topologiesResource, name, options), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// List takes label and field selectors, and returns the list of Topologies that match those selectors.
+func (c *FakeTopologies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TopologyList, err error) {
+ emptyResult := &v1alpha1.TopologyList{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootListActionWithOptions(topologiesResource, topologiesKind, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1alpha1.TopologyList{ListMeta: obj.(*v1alpha1.TopologyList).ListMeta}
+ for _, item := range obj.(*v1alpha1.TopologyList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested topologies.
+func (c *FakeTopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewRootWatchActionWithOptions(topologiesResource, opts))
+}
+
+// Create takes the representation of a topology and creates it. Returns the server's representation of the topology, and an error, if there is any.
+func (c *FakeTopologies) Create(ctx context.Context, topology *v1alpha1.Topology, opts v1.CreateOptions) (result *v1alpha1.Topology, err error) {
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootCreateActionWithOptions(topologiesResource, topology, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// Update takes the representation of a topology and updates it. Returns the server's representation of the topology, and an error, if there is any.
+func (c *FakeTopologies) Update(ctx context.Context, topology *v1alpha1.Topology, opts v1.UpdateOptions) (result *v1alpha1.Topology, err error) {
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootUpdateActionWithOptions(topologiesResource, topology, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeTopologies) UpdateStatus(ctx context.Context, topology *v1alpha1.Topology, opts v1.UpdateOptions) (result *v1alpha1.Topology, err error) {
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(topologiesResource, "status", topology, opts), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// Delete takes name of the topology and deletes it. Returns an error if one occurs.
+func (c *FakeTopologies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewRootDeleteActionWithOptions(topologiesResource, name, opts), &v1alpha1.Topology{})
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeTopologies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action := testing.NewRootDeleteCollectionActionWithOptions(topologiesResource, opts, listOpts)
+
+ _, err := c.Fake.Invokes(action, &v1alpha1.TopologyList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched topology.
+func (c *FakeTopologies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Topology, err error) {
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(topologiesResource, name, pt, data, opts, subresources...), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// Apply takes the given apply declarative configuration, applies it and returns the applied topology.
+func (c *FakeTopologies) Apply(ctx context.Context, topology *kueuev1alpha1.TopologyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Topology, err error) {
+ if topology == nil {
+ return nil, fmt.Errorf("topology provided to Apply must not be nil")
+ }
+ data, err := json.Marshal(topology)
+ if err != nil {
+ return nil, err
+ }
+ name := topology.Name
+ if name == nil {
+ return nil, fmt.Errorf("topology.Name must be provided to Apply")
+ }
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(topologiesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
+
+// ApplyStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
+func (c *FakeTopologies) ApplyStatus(ctx context.Context, topology *kueuev1alpha1.TopologyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Topology, err error) {
+ if topology == nil {
+ return nil, fmt.Errorf("topology provided to Apply must not be nil")
+ }
+ data, err := json.Marshal(topology)
+ if err != nil {
+ return nil, err
+ }
+ name := topology.Name
+ if name == nil {
+ return nil, fmt.Errorf("topology.Name must be provided to Apply")
+ }
+ emptyResult := &v1alpha1.Topology{}
+ obj, err := c.Fake.
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(topologiesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
+ if obj == nil {
+ return emptyResult, err
+ }
+ return obj.(*v1alpha1.Topology), err
+}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
index 5f6c8d4e03..6601341f10 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/generated_expansion.go
@@ -16,3 +16,5 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
+
+type TopologyExpansion interface{}
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
index eea935c7fe..f8d9f2d670 100644
--- a/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/kueue_client.go
@@ -27,6 +27,7 @@ import (
type KueueV1alpha1Interface interface {
RESTClient() rest.Interface
+ TopologiesGetter
}
// KueueV1alpha1Client is used to interact with features provided by the kueue.x-k8s.io group.
@@ -34,6 +35,10 @@ type KueueV1alpha1Client struct {
restClient rest.Interface
}
+func (c *KueueV1alpha1Client) Topologies() TopologyInterface {
+ return newTopologies(c)
+}
+
// NewForConfig creates a new KueueV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
diff --git a/client-go/clientset/versioned/typed/kueue/v1alpha1/topology.go b/client-go/clientset/versioned/typed/kueue/v1alpha1/topology.go
new file mode 100644
index 0000000000..2ca2625373
--- /dev/null
+++ b/client-go/clientset/versioned/typed/kueue/v1alpha1/topology.go
@@ -0,0 +1,72 @@
+/*
+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.
+*/
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ gentype "k8s.io/client-go/gentype"
+ v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ kueuev1alpha1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1alpha1"
+ scheme "sigs.k8s.io/kueue/client-go/clientset/versioned/scheme"
+)
+
+// TopologiesGetter has a method to return a TopologyInterface.
+// A group's client should implement this interface.
+type TopologiesGetter interface {
+ Topologies() TopologyInterface
+}
+
+// TopologyInterface has methods to work with Topology resources.
+type TopologyInterface interface {
+ Create(ctx context.Context, topology *v1alpha1.Topology, opts v1.CreateOptions) (*v1alpha1.Topology, error)
+ Update(ctx context.Context, topology *v1alpha1.Topology, opts v1.UpdateOptions) (*v1alpha1.Topology, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+ UpdateStatus(ctx context.Context, topology *v1alpha1.Topology, opts v1.UpdateOptions) (*v1alpha1.Topology, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Topology, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TopologyList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Topology, err error)
+ Apply(ctx context.Context, topology *kueuev1alpha1.TopologyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Topology, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
+ ApplyStatus(ctx context.Context, topology *kueuev1alpha1.TopologyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Topology, err error)
+ TopologyExpansion
+}
+
+// topologies implements TopologyInterface
+type topologies struct {
+ *gentype.ClientWithListAndApply[*v1alpha1.Topology, *v1alpha1.TopologyList, *kueuev1alpha1.TopologyApplyConfiguration]
+}
+
+// newTopologies returns a Topologies
+func newTopologies(c *KueueV1alpha1Client) *topologies {
+ return &topologies{
+ gentype.NewClientWithListAndApply[*v1alpha1.Topology, *v1alpha1.TopologyList, *kueuev1alpha1.TopologyApplyConfiguration](
+ "topologies",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1alpha1.Topology { return &v1alpha1.Topology{} },
+ func() *v1alpha1.TopologyList { return &v1alpha1.TopologyList{} }),
+ }
+}
diff --git a/client-go/informers/externalversions/generic.go b/client-go/informers/externalversions/generic.go
index f4fb966790..3084e7dc81 100644
--- a/client-go/informers/externalversions/generic.go
+++ b/client-go/informers/externalversions/generic.go
@@ -22,8 +22,9 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
+ v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
- v1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
+ visibilityv1alpha1 "sigs.k8s.io/kueue/apis/visibility/v1alpha1"
visibilityv1beta1 "sigs.k8s.io/kueue/apis/visibility/v1beta1"
)
@@ -53,7 +54,11 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
- // Group=kueue.x-k8s.io, Version=v1beta1
+ // Group=kueue.x-k8s.io, Version=v1alpha1
+ case v1alpha1.SchemeGroupVersion.WithResource("topologies"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1alpha1().Topologies().Informer()}, nil
+
+ // Group=kueue.x-k8s.io, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithResource("admissionchecks"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().AdmissionChecks().Informer()}, nil
case v1beta1.SchemeGroupVersion.WithResource("clusterqueues"):
@@ -74,9 +79,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Kueue().V1beta1().WorkloadPriorityClasses().Informer()}, nil
// Group=visibility.kueue.x-k8s.io, Version=v1alpha1
- case v1alpha1.SchemeGroupVersion.WithResource("clusterqueues"):
+ case visibilityv1alpha1.SchemeGroupVersion.WithResource("clusterqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1alpha1().ClusterQueues().Informer()}, nil
- case v1alpha1.SchemeGroupVersion.WithResource("localqueues"):
+ case visibilityv1alpha1.SchemeGroupVersion.WithResource("localqueues"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Visibility().V1alpha1().LocalQueues().Informer()}, nil
// Group=visibility.kueue.x-k8s.io, Version=v1beta1
diff --git a/client-go/informers/externalversions/kueue/interface.go b/client-go/informers/externalversions/kueue/interface.go
index 28943b8c66..7f89811e13 100644
--- a/client-go/informers/externalversions/kueue/interface.go
+++ b/client-go/informers/externalversions/kueue/interface.go
@@ -19,11 +19,14 @@ package kueue
import (
internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
+ v1alpha1 "sigs.k8s.io/kueue/client-go/informers/externalversions/kueue/v1alpha1"
v1beta1 "sigs.k8s.io/kueue/client-go/informers/externalversions/kueue/v1beta1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
+ // V1alpha1 provides access to shared informers for resources in V1alpha1.
+ V1alpha1() v1alpha1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
}
@@ -39,6 +42,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
+// V1alpha1 returns a new v1alpha1.Interface.
+func (g *group) V1alpha1() v1alpha1.Interface {
+ return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
+}
+
// V1beta1 returns a new v1beta1.Interface.
func (g *group) V1beta1() v1beta1.Interface {
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
diff --git a/client-go/informers/externalversions/kueue/v1alpha1/interface.go b/client-go/informers/externalversions/kueue/v1alpha1/interface.go
new file mode 100644
index 0000000000..aebd35f5b7
--- /dev/null
+++ b/client-go/informers/externalversions/kueue/v1alpha1/interface.go
@@ -0,0 +1,44 @@
+/*
+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.
+*/
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // Topologies returns a TopologyInformer.
+ Topologies() TopologyInformer
+}
+
+type version struct {
+ factory internalinterfaces.SharedInformerFactory
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
+ return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
+}
+
+// Topologies returns a TopologyInformer.
+func (v *version) Topologies() TopologyInformer {
+ return &topologyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
+}
diff --git a/client-go/informers/externalversions/kueue/v1alpha1/topology.go b/client-go/informers/externalversions/kueue/v1alpha1/topology.go
new file mode 100644
index 0000000000..c75f75ce5d
--- /dev/null
+++ b/client-go/informers/externalversions/kueue/v1alpha1/topology.go
@@ -0,0 +1,88 @@
+/*
+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.
+*/
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "context"
+ time "time"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ kueuev1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+ versioned "sigs.k8s.io/kueue/client-go/clientset/versioned"
+ internalinterfaces "sigs.k8s.io/kueue/client-go/informers/externalversions/internalinterfaces"
+ v1alpha1 "sigs.k8s.io/kueue/client-go/listers/kueue/v1alpha1"
+)
+
+// TopologyInformer provides access to a shared informer and lister for
+// Topologies.
+type TopologyInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1alpha1.TopologyLister
+}
+
+type topologyInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// NewTopologyInformer constructs a new informer for Topology type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewTopologyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredTopologyInformer(client, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredTopologyInformer constructs a new informer for Topology type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredTopologyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.KueueV1alpha1().Topologies().List(context.TODO(), options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.KueueV1alpha1().Topologies().Watch(context.TODO(), options)
+ },
+ },
+ &kueuev1alpha1.Topology{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *topologyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredTopologyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *topologyInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&kueuev1alpha1.Topology{}, f.defaultInformer)
+}
+
+func (f *topologyInformer) Lister() v1alpha1.TopologyLister {
+ return v1alpha1.NewTopologyLister(f.Informer().GetIndexer())
+}
diff --git a/client-go/listers/kueue/v1alpha1/expansion_generated.go b/client-go/listers/kueue/v1alpha1/expansion_generated.go
new file mode 100644
index 0000000000..a760283dd1
--- /dev/null
+++ b/client-go/listers/kueue/v1alpha1/expansion_generated.go
@@ -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.
+*/
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// TopologyListerExpansion allows custom methods to be added to
+// TopologyLister.
+type TopologyListerExpansion interface{}
diff --git a/client-go/listers/kueue/v1alpha1/topology.go b/client-go/listers/kueue/v1alpha1/topology.go
new file mode 100644
index 0000000000..db8d56ec23
--- /dev/null
+++ b/client-go/listers/kueue/v1alpha1/topology.go
@@ -0,0 +1,47 @@
+/*
+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.
+*/
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
+ "k8s.io/client-go/tools/cache"
+ v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
+)
+
+// TopologyLister helps list Topologies.
+// All objects returned here must be treated as read-only.
+type TopologyLister interface {
+ // List lists all Topologies in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1alpha1.Topology, err error)
+ // Get retrieves the Topology from the index for a given name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1alpha1.Topology, error)
+ TopologyListerExpansion
+}
+
+// topologyLister implements the TopologyLister interface.
+type topologyLister struct {
+ listers.ResourceIndexer[*v1alpha1.Topology]
+}
+
+// NewTopologyLister returns a new TopologyLister.
+func NewTopologyLister(indexer cache.Indexer) TopologyLister {
+ return &topologyLister{listers.New[*v1alpha1.Topology](indexer, v1alpha1.Resource("topology"))}
+}
diff --git a/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml b/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
index a2d6a34ef0..2c0b1e5ace 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_resourceflavors.yaml
@@ -171,6 +171,12 @@ spec:
''NoExecute'''
rule: self.all(x, !has(x.effect) || x.effect in ['NoSchedule', 'PreferNoSchedule',
'NoExecute'])
+ topologyName:
+ description: |-
+ topologyName indicates topology for the TAS ResourceFlavor.
+ When specified, it enables scraping of the topology information from the
+ nodes matching to the Resource Flavor node labels.
+ type: string
type: object
type: object
served: true
diff --git a/config/components/crd/bases/kueue.x-k8s.io_topologies.yaml b/config/components/crd/bases/kueue.x-k8s.io_topologies.yaml
new file mode 100644
index 0000000000..58a390aa7f
--- /dev/null
+++ b/config/components/crd/bases/kueue.x-k8s.io_topologies.yaml
@@ -0,0 +1,76 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.16.4
+ name: topologies.kueue.x-k8s.io
+spec:
+ group: kueue.x-k8s.io
+ names:
+ kind: Topology
+ listKind: TopologyList
+ plural: topologies
+ singular: topology
+ scope: Cluster
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ description: Topology is the Schema for the topology API
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: TopologySpec defines the desired state of Topology
+ properties:
+ levels:
+ description: levels define the levels of topology.
+ items:
+ description: TopologyLevel defines the desired state of TopologyLevel
+ properties:
+ nodeLabel:
+ description: |-
+ nodeLabel indicates the name of the node label for a specific topology
+ level.
+
+ Examples:
+ - cloud.provider.com/topology-block
+ - cloud.provider.com/topology-rack
+ maxLength: 316
+ minLength: 1
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - nodeLabel
+ type: object
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - levels
+ type: object
+ status:
+ description: TopologyStatus defines the observed state of Topology
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml b/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
index e7907469e1..151042d6d1 100644
--- a/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
+++ b/config/components/crd/bases/kueue.x-k8s.io_workloads.yaml
@@ -8168,6 +8168,23 @@ spec:
- containers
type: object
type: object
+ topologyRequest:
+ description: topologyRequest defines the topology request for
+ the PodSet.
+ properties:
+ preferred:
+ description: |-
+ preferred indicates the topology level preferred by the PodSet, as
+ indicated by the `kueue.x-k8s.io/podset-preferred-topology` PodSet
+ annotation.
+ type: string
+ required:
+ description: |-
+ required indicates the topology level required by the PodSet, as
+ indicated by the `kueue.x-k8s.io/podset-required-topology` PodSet
+ annotation.
+ type: string
+ type: object
required:
- count
- template
@@ -8285,6 +8302,80 @@ spec:
the LimitRange defaults and RuntimeClass overheads at the moment of admission.
This field will not change in case of quota reclaim.
type: object
+ topologyAssignment:
+ description: |-
+ topologyAssignment indicates the topology assignment divided into
+ topology domains corresponding to the lowest level of the topology.
+ The assignment specifies the number of Pods to be scheduled per topology
+ domain and specifies the node selectors for each topology domain, in the
+ following way: the node selector keys are specified by the levels field
+ (same for all domains), and the corresponding node selector value is
+ specified by the domains.values subfield.
+
+ Example:
+
+ topologyAssignment:
+ levels:
+ - cloud.provider.com/topology-block
+ - cloud.provider.com/topology-rack
+ domains:
+ - values: [block-1, rack-1]
+ count: 4
+ - values: [block-1, rack-2]
+ count: 2
+
+ Here:
+ - 4 Pods are to be scheduled on nodes matching the node selector:
+ cloud.provider.com/topology-block: block-1
+ cloud.provider.com/topology-rack: rack-1
+ - 2 Pods are to be scheduled on nodes matching the node selector:
+ cloud.provider.com/topology-block: block-1
+ cloud.provider.com/topology-rack: rack-2
+ properties:
+ domains:
+ description: |-
+ domains is a list of topology assignments split by topology domains at
+ the lowest level of the topology.
+ items:
+ properties:
+ count:
+ description: |-
+ count indicates the number of Pods to be scheduled in the topology
+ domain indicated by the values field.
+ format: int32
+ minimum: 1
+ type: integer
+ values:
+ description: |-
+ values is an ordered list of node selector values describing a topology
+ domain. The values correspond to the consecutive topology levels, from
+ the highest to the lowest.
+ items:
+ type: string
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - count
+ - values
+ type: object
+ type: array
+ levels:
+ description: |-
+ levels is an ordered list of keys denoting the levels of the assigned
+ topology (i.e. node label keys), from the highest to the lowest level of
+ the topology.
+ items:
+ type: string
+ maxItems: 8
+ minItems: 1
+ type: array
+ x-kubernetes-list-type: atomic
+ required:
+ - domains
+ - levels
+ type: object
required:
- name
type: object
diff --git a/config/components/crd/kustomization.yaml b/config/components/crd/kustomization.yaml
index b87cb805af..f246167b83 100644
--- a/config/components/crd/kustomization.yaml
+++ b/config/components/crd/kustomization.yaml
@@ -12,6 +12,7 @@ resources:
- bases/kueue.x-k8s.io_provisioningrequestconfigs.yaml
- bases/kueue.x-k8s.io_multikueueconfigs.yaml
- bases/kueue.x-k8s.io_multikueueclusters.yaml
+- bases/kueue.x-k8s.io_topologies.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patches:
diff --git a/site/content/en/docs/reference/kueue-alpha.v1alpha1.md b/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
index 6e571fe6d6..edf81f44fb 100644
--- a/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
+++ b/site/content/en/docs/reference/kueue-alpha.v1alpha1.md
@@ -10,8 +10,42 @@ description: Generated API reference documentation for kueue.x-k8s.io/v1alpha1.
## Resource Types
+- [Topology](#kueue-x-k8s-io-v1alpha1-Topology)
+## `Topology` {#kueue-x-k8s-io-v1alpha1-Topology}
+
+
+**Appears in:**
+
+
+
+Topology is the Schema for the topology API
+
+
+
+Field | Description |
+
+
+apiVersion string | kueue.x-k8s.io/v1alpha1 |
+kind string | Topology |
+
+
+spec [Required]
+TopologySpec
+ |
+
+ No description provided. |
+
+status [Required]
+TopologyStatus
+ |
+
+ No description provided. |
+
+
+
+
## `Cohort` {#kueue-x-k8s-io-v1alpha1-Cohort}
@@ -123,4 +157,75 @@ will be rejected by the webhook.
+
+## `TopologyLevel` {#kueue-x-k8s-io-v1alpha1-TopologyLevel}
+
+
+**Appears in:**
+
+- [TopologySpec](#kueue-x-k8s-io-v1alpha1-TopologySpec)
+
+
+TopologyLevel defines the desired state of TopologyLevel
+
+
+
+Field | Description |
+
+
+
+nodeLabel [Required]
+string
+ |
+
+ nodeLabel indicates the name of the node label for a specific topology
+level.
+Examples:
+
+- cloud.provider.com/topology-block
+- cloud.provider.com/topology-rack
+
+ |
+
+
+
+
+## `TopologySpec` {#kueue-x-k8s-io-v1alpha1-TopologySpec}
+
+
+**Appears in:**
+
+- [Topology](#kueue-x-k8s-io-v1alpha1-Topology)
+
+
+TopologySpec defines the desired state of Topology
+
+
+
+Field | Description |
+
+
+
+levels [Required]
+[]TopologyLevel
+ |
+
+ levels define the levels of topology.
+ |
+
+
+
+
+## `TopologyStatus` {#kueue-x-k8s-io-v1alpha1-TopologyStatus}
+
+
+**Appears in:**
+
+- [Topology](#kueue-x-k8s-io-v1alpha1-Topology)
+
+
+TopologyStatus defines the observed state of Topology
+
+
+
\ No newline at end of file
diff --git a/site/content/en/docs/reference/kueue.v1beta1.md b/site/content/en/docs/reference/kueue.v1beta1.md
index a11633e86e..1a90bf7159 100644
--- a/site/content/en/docs/reference/kueue.v1beta1.md
+++ b/site/content/en/docs/reference/kueue.v1beta1.md
@@ -1542,6 +1542,13 @@ enabled.
This is an alpha field and requires enabling PartialAdmission feature gate.
+topologyRequest
+PodSetTopologyRequest
+ |
+
+ topologyRequest defines the topology request for the PodSet.
+ |
+
@@ -1593,6 +1600,77 @@ Value could be missing for Workloads created before this field was added,
in that case spec.podSets[*].count value will be used.
+topologyAssignment
+TopologyAssignment
+ |
+
+ topologyAssignment indicates the topology assignment divided into
+topology domains corresponding to the lowest level of the topology.
+The assignment specifies the number of Pods to be scheduled per topology
+domain and specifies the node selectors for each topology domain, in the
+following way: the node selector keys are specified by the levels field
+(same for all domains), and the corresponding node selector value is
+specified by the domains.values subfield.
+Example:
+topologyAssignment:
+levels:
+
+- cloud.provider.com/topology-block
+- cloud.provider.com/topology-rack
+domains:
+- values: [block-1, rack-1]
+count: 4
+- values: [block-1, rack-2]
+count: 2
+
+Here:
+
+- 4 Pods are to be scheduled on nodes matching the node selector:
+cloud.provider.com/topology-block: block-1
+cloud.provider.com/topology-rack: rack-1
+- 2 Pods are to be scheduled on nodes matching the node selector:
+cloud.provider.com/topology-block: block-1
+cloud.provider.com/topology-rack: rack-2
+
+ |
+
+
+
+
+## `PodSetTopologyRequest` {#kueue-x-k8s-io-v1beta1-PodSetTopologyRequest}
+
+
+**Appears in:**
+
+- [PodSet](#kueue-x-k8s-io-v1beta1-PodSet)
+
+
+PodSetTopologyRequest defines the topology request for a PodSet.
+
+
+
+Field | Description |
+
+
+
+required
+string
+ |
+
+ required indicates the topology level required by the PodSet, as
+indicated by the kueue.x-k8s.io/podset-required-topology PodSet
+annotation.
+ |
+
+preferred
+string
+ |
+
+ preferred indicates the topology level preferred by the PodSet, as
+indicated by the kueue.x-k8s.io/podset-preferred-topology PodSet
+annotation.
+ |
+
@@ -1862,6 +1940,15 @@ cloud.provider.com/preemptible="true":NoSchedule
tolerations can be up to 8 elements.
+topologyName
+string
+ |
+
+ topologyName indicates topology for the TAS ResourceFlavor.
+When specified, it enables scraping of the topology information from the
+nodes matching to the Resource Flavor node labels.
+ |
+
@@ -2030,6 +2117,74 @@ words, it's the used quota that is over the nominalQuota.
+## `TopologyAssignment` {#kueue-x-k8s-io-v1beta1-TopologyAssignment}
+
+
+**Appears in:**
+
+- [PodSetAssignment](#kueue-x-k8s-io-v1beta1-PodSetAssignment)
+
+
+
+
+Field | Description |
+
+
+
+levels [Required]
+[]string
+ |
+
+ levels is an ordered list of keys denoting the levels of the assigned
+topology (i.e. node label keys), from the highest to the lowest level of
+the topology.
+ |
+
+domains [Required]
+[]TopologyDomainAssignment
+ |
+
+ domains is a list of topology assignments split by topology domains at
+the lowest level of the topology.
+ |
+
+
+
+
+## `TopologyDomainAssignment` {#kueue-x-k8s-io-v1beta1-TopologyDomainAssignment}
+
+
+**Appears in:**
+
+- [TopologyAssignment](#kueue-x-k8s-io-v1beta1-TopologyAssignment)
+
+
+
+
+Field | Description |
+
+
+
+values [Required]
+[]string
+ |
+
+ values is an ordered list of node selector values describing a topology
+domain. The values correspond to the consecutive topology levels, from
+the highest to the lowest.
+ |
+
+count [Required]
+int32
+ |
+
+ count indicates the number of Pods to be scheduled in the topology
+domain indicated by the values field.
+ |
+
+
+
+
## `WorkloadSpec` {#kueue-x-k8s-io-v1beta1-WorkloadSpec}