Chapter 2. Red Hat build of Kueue
2.1. Introduction to Red Hat build of Kueue Copy linkLink copied to clipboard!
You can use Red Hat build of Kueue to manage when jobs in your Kubernetes cluster start, get preempted, or wait for resources. Red Hat build of Kueue optimizes resource utilization by enforcing quotas and scheduling policies across your workloads.
Red Hat build of Kueue can determine when a job waits, is admitted to start by creating pods, or should be preempted, meaning that active pods for that job are deleted.
In the context of Red Hat build of Kueue, a job can be defined as a one-time or on-demand task that runs to completion.
Red Hat build of Kueue is based on the Kueue open source project.
Red Hat build of Kueue is compatible with environments that use heterogeneous, elastic resources, where many different resource types exist and those resources are capable of dynamic scaling.
Red Hat build of Kueue does not replace any existing components in a Kubernetes cluster, but instead integrates with the existing Kubernetes API server, scheduler, and cluster autoscaler components.
Red Hat build of Kueue supports all-or-nothing semantics, where either an entire job with all of its components is admitted to the cluster, or the entire job is rejected if it does not fit on the cluster.
2.1.1. Personas Copy linkLink copied to clipboard!
Different personas exist in a Red Hat build of Kueue workflow.
- Batch administrators
- Batch administrators manage the cluster infrastructure and establish quotas and queues.
- Batch users
- Batch users run jobs on the cluster. Examples of batch users might be researchers, AI/ML engineers, or data scientists.
- Serving users
- Serving users run jobs on the cluster. For example, to expose a trained AI/ML model for inference.
- Platform developers
- Platform developers integrate Red Hat build of Kueue with other software. They might also contribute to the Kueue open source project.
2.1.2. Workflow overview Copy linkLink copied to clipboard!
The Red Hat build of Kueue workflow can be described at a high level as follows:
-
Batch administrators create and configure
ResourceFlavor,LocalQueue, andClusterQueueresources. - User personas create jobs on the cluster.
- The Kubernetes API server validates and accepts job data.
-
Red Hat build of Kueue admits jobs based on configured options, such as order or quota. It injects affinity into the job by using resource flavors, and creates a
Workloadobject that corresponds to each job. - The applicable controller for the job type creates pods.
- The Kubernetes scheduler assigns pods to a node in the cluster.
- The Kubernetes cluster autoscaler provisions more nodes as required.
2.2. Release notes Copy linkLink copied to clipboard!
Red Hat build of Kueue is released as an Operator that is supported on OpenShift Container Platform.
2.2.1. Compatible environments Copy linkLink copied to clipboard!
Your cluster must meet specific architecture and platform requirements before you can install Red Hat build of Kueue.
2.2.1.1. Supported architectures Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following architectures:
- ARM64
- 64-bit x86
- ppc64le (IBM Power®)
- s390x (IBM Z®)
2.2.1.2. Supported platforms Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following platforms:
- OpenShift Container Platform
- Hosted control planes for OpenShift Container Platform
Currently, Red Hat build of Kueue is not supported on Red Hat build of MicroShift (MicroShift).
2.2.2. Release notes for Red Hat build of Kueue version 1.4.1 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.4.1 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.4.1 uses Kueue version 0.18.
2.2.2.1. Fixed issues Copy linkLink copied to clipboard!
- Red Hat build of Kueue no longer accepts invalid webhook configurations at admission time
Before this update, Red Hat build of Kueue filtered out core validating webhooks during reconciliation. As a consequence, the Operator silently accepted invalid webhook configurations for the following resources:
-
Cohort -
ClusterQueue -
Workload -
ResourceFlavor
-
With this release, the Operator always registers validating webhooks. As a result, Red Hat build of Kueue rejects invalid configurations at admission time.
2.2.3. Release notes for Red Hat build of Kueue version 1.4 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.4 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.4 uses Kueue version 0.18.
2.2.3.1. New features and enhancements Copy linkLink copied to clipboard!
- Admission fair sharing
This release introduces admission fair sharing, which balances workload admission across multiple local Queues feeding into a shared
ClusterQueue. Admission fair sharing:- Prioritizes workloads based on historical resource consumption
- Tracks usage over time with a configurable decay function
- Applies immediate admission penalties to prevent resource monopolization
For more information, see Admission fair sharing.
- Dynamic Resource Allocation (DRA) quota management for GPUs (Technology Preview)
- You can manage quotas for workloads that request GPUs through Dynamic Resource Allocation (DRA). When quota management is configured, Red Hat build of Kueue tracks DRA device requests toward quota alongside traditional resources such as CPU and memory, preventing teams from exceeding their allocated GPU resources.
For more information, see Integrating Dynamic Resource Allocation.
2.2.3.2. Fixed issues Copy linkLink copied to clipboard!
- Use the
resourceNamesobject to limit webhooks to only Red Hat build of Kueue resources You can restrict the
kueue-manager-roleClusterRolewebhook configurations and CRD rules to specificresourceNames, preventing the controller from modifying other Operators' webhook configurations or CRDs. Webhook rules are scoped tokueue-mutating-webhook-configurationandkueue-validating-webhook-configuration, as shown in this example:resourceNames: - kueue-mutating-webhook-configuration - kueue-validating-webhook-configuration- Removed secrets from the core API resources list
The upstream version of Kueue moved the
secretsRBAC to a namespace-scoped role (kueue-manager-secrets-role), but theClusterRolewas not updated to remove the cluster-wide secrets permission.This version of Red Hat build of Kueue removes the
secretsresource type from the cluster-wide openshift-kueue-operatorClusterRole. The namespace-scopedkueue-manager-secrets-rolerole already exists and provides the necessary access.
2.2.4. Release notes for Red Hat build of Kueue version 1.3.1 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.3.1 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.3 uses Kueue version 0.16.5.
2.2.4.1. Fixed issues Copy linkLink copied to clipboard!
- kueue.x-k8s.io/queue-name refers to a non-existent queue
Fixed a bug where referencing a non-existent
LocalQueue via kueue.x-k8s.io/queue-namecould cause a running pod to be terminated and permanently stuck with unremovable scheduling gates.
2.2.5. Release notes for Red Hat build of Kueue version 1.3 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.3 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.3 uses Kueue version 0.16.
2.2.5.1. New features and enhancements Copy linkLink copied to clipboard!
- Leader Worker Set Operator
- Red Hat build of Kueue version 1.3 provides for the integration of the Leader Worker Set Operator with Red Hat build of Kueue so you can leverage the Red Hat build of Kueue scheduling and resource management functionality when running LeaderWorkerSets. For more information, see Integrating the Leader Worker Set Operator.
- JobSet Operator
- Red Hat build of Kueue version 1.3 provides for the integration of the JobSet Operator so you can use the JobSet Operator to manage and run large-scale, coordinated workloads like high-performance computing (HPC) and AI training. For more information, see Integrating the JobSet Operator.
- Upstream progression of the Red Hat build of Kueue API to
v1beta2 Red Hat build of Kueue version 1.3 provides the
v1beta2version of the Red Hat build of Kueue API. This update continues the evolution of the Red Hat build of Kueue APIs with the ultimate goal of graduating the API tov1.All new Kueue objects created after the upgrade will be stored using the
v1beta2version. The earlier version of the API,v1beta1is deprecated. Objects can still be created usingv1beta1, if necessary. In these cases, a deprecation message is shown.However, existing objects are only auto-converted to the new storage version by Kubernetes during a write request. This means that Red Hat build of Kueue API objects that rarely receive updates such as Topologies, ResourceFlavors, or long-running Workloads could remain in the older
v1beta1format indefinitely.
2.2.5.2. Fixed issues Copy linkLink copied to clipboard!
- Reconcile jobs only in opt-in namespaces
OpenShift Container Platform allowed reconciliation of
Jobresources that have thekueue.x-k8s.io/queue-namelabel, even if these resources are in namespaces that are not configured to opt in to being managed by OpenShift Container Platform. With this release, there is ongoing upstream work that updates this behavior so that Jobs with queue-name labels are also ignored unless their namespace matches themanagedJobsNamespaceSelector. This change makes Red Hat build of Kueue behavior consistent across all integrations.KueueCR description reads as "Not available" in the OpenShift Container Platform web consoleAfter installing Red Hat build of Kueue, in the Operator details view, the description for the
KueueCR read as "Not available". This issue did not affect or degrade the Red Hat build of Kueue Operator functionality. With this release, the "Not available" message no longer displays.- LeaderWorkerSet and Jobset validation errors
Currently, the Leader Worker Set Operator and JobSet Operator are only validated after the Operand CR is updated and the full Kueue hierarchy (ResourceFlavor, ClusterQueue, and LocalQueue) is established. Any configuration errors appear only when applying a LeaderWorkerSet or JobSet template.
2.2.5.3. Known issues Copy linkLink copied to clipboard!
- LeaderWorkerSet pods update sequentially by default
If you have integrated Leader Worker Set Operator with your Red Hat build of Kueue installation and you are using the rollout strategy option for updating LeaderWorkerSet pods, be aware that the
MaxUnavailablefeature gate in OpenShift Container Platform is disabled by default.When any change is made to LeaderWorkerSet pods, a rolling update is triggered. This action gradually replaces the old pods of a deployment with new ones, keeping as many pods alive as possible to avoid downtime. If
MaxUnavailableis disabled, which is the OpenShift Container Platform default setting, the pods are updated one at a time.If you want to run updates in parallel instead of running them sequentially,
MaxUnavailablefeature gate must be enabled. For more information, see Enabling feature sets at installation and Rollout Strategy.
2.2.6. Release notes for Red Hat build of Kueue version 1.2 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.2 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.2 uses Kueue version 0.14.
2.2.6.1. New features and enhancements Copy linkLink copied to clipboard!
- Monitoring of pending workloads
-
Red Hat build of Kueue version 1.2 provides the
VisibilityOnDemandfeature to monitor the pipeline of pending jobs in the cluster queue and the local queue, and help users to estimate when their jobs will start. For more information, see Monitoring pending workloads.
2.2.6.2. Fixed issues Copy linkLink copied to clipboard!
- Custom resources are not deleted properly when you uninstall Red Hat build of Kueue
After you uninstall the Red Hat Build of Kueue Operator using the Delete all operand instances for this operator option in the OpenShift Container Platform web console, Red Hat build of Kueue custom resources were attempted to be deleted. With this release, they are not considered for deletion.
- Documentation error in previous versions of Red Hat build of Kueue
In Creating a Kueue custom resource, the optional workload types
Pod,Deployment,StatefulSetwere omitted. They are now included.- Red Hat build of Kueue metrics were not being exposed to Prometheus from version 1.1
Prometheus was not scraping metrics from the Operator’s controller, even though the ServiceMonitor and RBAC resources were successfully created as part of the Operator installation. As a result, none of the Kueue metrics were available in the cluster monitoring stack.
The metrics service added during the installation was configured with an incorrect port reference, causing Prometheus to fail in scraping metrics from the Kueue endpoint. The port name has been updated with the correct port name.
2.2.6.3. Known issues Copy linkLink copied to clipboard!
- Reconcile jobs only in opt-in namespaces
OpenShift Container Platform allows reconciliation of
Jobresources that have thekueue.x-k8s.io/queue-namelabel, even if these resources are in namespaces which are not configured to opt in to being managed by OpenShift Container Platform. This is inconsistent with the behavior for other core integrations like pods, deployments, and stateful sets, which are only reconciled if they are in namespaces which have been configured to opt in to being managed by OpenShift Container Platform by adding thekueue.openshift.io/managed=true.KueueCR description reads as "Not available" in the OpenShift Container Platform web consoleAfter installing Red Hat build of Kueue, in the Operator details view, the description for the
KueueCR reads as "Not available". This issue does not affect or degrade the Red Hat build of Kueue Operator functionality.
2.2.7. Release notes for Red Hat build of Kueue version 1.1 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and later. Red Hat build of Kueue version 1.1 uses Kueue version 0.12.
If you have a previously installed version of Red Hat build of Kueue on your cluster, you must uninstall the Operator and manually install version 1.1. For information see Upgrading Red Hat build of Kueue.
2.2.7.1. New features and enhancements Copy linkLink copied to clipboard!
- Configure a default local queue
A default local queue serves as the local queue for newly created jobs that do not have the
kueue.x-k8s.io/queue-namelabel. After you create a default local queue, any new jobs created in the namespace without akueue.x-k8s.io/queue-namelabel automatically update to have thekueue.x-k8s.io/queue-name: defaultlabel.(RFE-7615)
- Multi-architecture and Hosted control planes support
With this release, Red Hat build of Kueue is supported on multiple different architectures, including ARM64, 64-bit x86, ppc64le (IBM Power®), and s390x (IBM Z®), as well as on Hosted control planes for OpenShift Container Platform.
2.2.7.2. Fixed issues Copy linkLink copied to clipboard!
- You can create a
Kueuecustom resource by using the OpenShift Container Platform web console Before this update, if you tried to use the OpenShift Container Platform web console to create a
Kueuecustom resource (CR) by using the form view, the web console showed an error and the resource could not be created. With this release, the default namespace was removed from theKueueCR template. As a result, you can use the OpenShift Container Platform web console to create aKueueCR by using the form view.
2.2.7.3. Known issues Copy linkLink copied to clipboard!
KueueCR description reads as "Not available" in the OpenShift Container Platform web consoleAfter you install Red Hat build of Kueue, in the Operator details view, the description for the
KueueCR reads as "Not available". This issue does not affect or degrade the Red Hat build of Kueue Operator functionality.- Custom resources are not deleted properly when you uninstall Red Hat build of Kueue
After you uninstall the Red Hat Build of Kueue Operator using the Delete all operand instances for this operator option in the OpenShift Container Platform web console, some Red Hat build of Kueue custom resources are not fully deleted. These resources can be viewed in the Installed Operators view with the status Resource is being deleted. As a workaround, you can manually delete the resource finalizers to remove them fully.
2.2.8. Release notes for Red Hat build of Kueue version 1.0.1 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.0.1 is a patch release that is supported on OpenShift Container Platform versions 4.18 and 4.19 on the 64-bit x86 architecture.
Red Hat build of Kueue version 1.0.1 uses Kueue version 0.11.
2.2.8.1. Bug fixes in Red Hat build of Kueue version 1.0.1 Copy linkLink copied to clipboard!
- Previously, leader election for Red Hat build of Kueue was not configured to tolerate disruption, which resulted in frequent crashing. With this release, the leader election values for Red Hat build of Kueue have been updated to match the durations recommended for OpenShift Container Platform. (OCPBUGS-58496)
-
Previously, the
ReadyReplicascount was not set in the reconciler, which meant that the Red Hat build of Kueue Operator status would report that there were no replicas ready. With this release, theReadyReplicascount is based on the number of ready replicas for the deployment, which ensures that the Operator shows as ready in the OpenShift Container Platform console when thekueue-controller-managerpods are ready. (OCPBUGS-59261) -
Previously, when the
Kueuecustom resource (CR) was deleted from theopenshift-kueue-operatornamespace, thekueue-manager-configconfig map was not deleted automatically and could remain in the namespace. With this release, thekueue-manager-configconfig map,kueue-webhook-server-certsecret, andmetrics-server-certsecret are deleted automatically when theKueueCR is deleted. (OCPBUGS-57960)
2.2.9. Release notes for Red Hat build of Kueue version 1.0 Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.0 is a generally available release that is supported on OpenShift Container Platform versions 4.18 and 4.19 on the 64-bit x86 architecture. Red Hat build of Kueue version 1.0 uses Kueue version 0.11.
2.2.9.1. New features and enhancements Copy linkLink copied to clipboard!
- Role-based access control (RBAC)
- Role-based access control (RBAC) enables you to control which types of users can create which types of Red Hat build of Kueue resources.
- Configure resource quotas
- Configuring resource quotas by creating cluster queues, resource flavors, and local queues enables you to control the amount of resources used by user-submitted jobs and workloads.
- Control job and workload management
- Labeling namespaces and configuring label policies enable you to control which jobs and workloads are managed by Red Hat build of Kueue.
- Share borrowable resources between queues
- Configuring cohorts, fair sharing, and gang scheduling settings enable you to share unused, borrowable resources between queues.
2.2.9.2. Known issues Copy linkLink copied to clipboard!
- Jobs in all namespaces are reconciled if they have the
kueue.x-k8s.io/queue-namelabel Red Hat build of Kueue uses the
managedJobsNamespaceSelectorconfiguration field, so that administrators can configure which namespaces opt in to be managed by Red Hat build of Kueue. Because namespaces must be manually configured to opt in to being managed by Red Hat build of Kueue, resources in system or third-party namespaces are not impacted or managed by Red Hat build of Kueue.The behavior in Red Hat build of Kueue 1.0 allows reconciliation of
Jobresources that have thekueue.x-k8s.io/queue-namelabel, even if these resources are in namespaces that are not configured to opt in to being managed by Red Hat build of Kueue. This is inconsistent with the behavior for other core integrations like pods, deployments, and stateful sets, which are only reconciled if they are in namespaces that have been configured to opt in to being managed by Red Hat build of Kueue.- You cannot create a
Kueuecustom resource by using the OpenShift Container Platform web console If you try to use the OpenShift Container Platform web console to create a
Kueuecustom resource (CR) by using the form view, the web console shows an error and the resource cannot be created. As a workaround, use the YAML view to create aKueueCR instead.
2.3. Installing Red Hat build of Kueue Copy linkLink copied to clipboard!
You can install Red Hat build of Kueue by using the Red Hat Build of Kueue Operator in OperatorHub.
2.3.1. Compatible environments Copy linkLink copied to clipboard!
Your cluster must meet specific architecture and platform requirements before you can install Red Hat build of Kueue.
2.3.1.1. Supported architectures Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following architectures:
- ARM64
- 64-bit x86
- ppc64le (IBM Power®)
- s390x (IBM Z®)
2.3.1.2. Supported platforms Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following platforms:
- OpenShift Container Platform
- Hosted control planes for OpenShift Container Platform
Currently, Red Hat build of Kueue is not supported on Red Hat build of MicroShift (MicroShift).
2.3.2. Installing the Red Hat Build of Kueue Operator Copy linkLink copied to clipboard!
You can install the Red Hat Build of Kueue Operator on a OpenShift Container Platform cluster by using the OperatorHub in the web console.
Prerequisites
- You have administrator permissions on a OpenShift Container Platform cluster.
- You have access to the OpenShift Container Platform web console.
- You have installed and configured the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Choose Red Hat Build of Kueue Operator from the list of available Operators, and click Install.
Select Enable Operator recommended cluster monitoring on this Namespace.
This option sets the
openshift.io/cluster-monitoring: "true"label in the Namespace object. You must select this option to ensure that cluster monitoring scrapes theopenshift-kueue-operatornamespace.Click Install.
NoteAlternatively, if you are creating the
Namespaceobject by using YAML, ensure that you include theopenshift.io/cluster-monitoring: "true"label:apiVersion: v1 kind: Namespace metadata: labels: openshift.io/cluster-monitoring: "true" name: openshift-kueue-operator
Verification
-
Go to Operators
Installed Operators and confirm that the Red Hat Build of Kueue Operator is listed with Status as Succeeded.
2.3.3. Upgrading Red Hat build of Kueue Copy linkLink copied to clipboard!
If you have previously installed Red Hat build of Kueue, you must manually upgrade your deployment to the latest version to use the latest bug fixes and feature enhancements.
Prerequisites
- You have installed a previous version of Red Hat build of Kueue.
- You are logged in to the OpenShift Container Platform web console with cluster administrator permissions.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators, then select Red Hat build of Kueue from the list. - From the Actions drop-down menu, select Uninstall Operator.
The Uninstall Operator? dialog box opens. Click Uninstall.
ImportantSelecting the Delete all operand instances for this operator checkbox before clicking Uninstall deletes all existing resources from the cluster, including:
-
The
KueueCR - Any cluster queues, local queues, or resource flavors that you have created
Leave this box unchecked when upgrading your cluster to retain your created resources.
-
The
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Choose Red Hat Build of Kueue Operator from the list of available Operators, and click Install.
Verification
-
Go to Operators
Installed Operators. - Confirm that the Red Hat Build of Kueue Operator is listed with Status as Succeeded.
- Confirm that the version shown under the Operator name in the list is the latest version.
2.3.4. Creating a Kueue custom resource Copy linkLink copied to clipboard!
After you have installed the Red Hat Build of Kueue Operator, you must create a Kueue custom resource (CR) to configure your installation.
Prerequisites
Ensure that you have completed the following prerequisites:
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have cluster administrator permissions and the
kueue-batch-admin-rolerole. - You have access to the OpenShift Container Platform web console.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - In the Provided APIs table column, click Kueue. This takes you to the Kueue tab of the Operator details page.
- Click Create Kueue. This takes you to the Create Kueue YAML view.
Enter the details for your
KueueCR.Example
KueueCRapiVersion: kueue.openshift.io/v1 kind: Kueue metadata: labels: app.kubernetes.io/name: kueue-operator app.kubernetes.io/managed-by: kustomize name: cluster namespace: openshift-kueue-operator spec: managementState: Managed config: integrations: frameworks: - BatchJob preemption: preemptionPolicy: Classical # ...where:
metadata.name-
Specifies the name of the
KueueCR. The value must becluster. spec.config.integrations.frameworks-
Specifies the workload types to configure for Red Hat build of Kueue. The default configuration is
BatchJob. Additional types arePod,Deployment, andStatefulSet. spec.config.preemption.preemptionPolicy-
Specifies the preemption policy for Red Hat build of Kueue. Set the value to
FairSharingto configure fair sharing. The default value isClassical. This value is optional.
- Click Create.
Verification
-
After you create the
KueueCR, the web console brings you to the Operator details page, where you can see the CR in the list of Kueues. Optional: If you have the OpenShift CLI (
oc) installed, you can run the following command and observe the output to confirm that yourKueueCR has been created successfully:$ oc get kueueExample output
NAME AGE cluster 4m
2.3.5. Labeling namespaces to allow Red Hat build of Kueue to manage jobs Copy linkLink copied to clipboard!
You must add the kueue.openshift.io/managed=true label to each namespace where you want Red Hat build of Kueue to manage jobs, because the Operator only enforces policies on labeled namespaces.
Prerequisites
- You have cluster administrator permissions.
-
The Red Hat build of Kueue Operator is installed on your cluster, and you have created a
Kueuecustom resource (CR). -
You have installed the OpenShift CLI (
oc).
Procedure
Add the
kueue.openshift.io/managed=truelabel to a namespace by running the following command:$ oc label namespace <namespace> kueue.openshift.io/managed=trueWhen you add this label, you instruct the Red Hat build of Kueue Operator that the namespace is managed by its webhook admission controllers. As a result, any Red Hat build of Kueue resources within that namespace are properly validated and mutated.
2.4. Installing Red Hat build of Kueue in a disconnected environment Copy linkLink copied to clipboard!
You can install Red Hat build of Kueue on a disconnected OpenShift Container Platform cluster after enabling Operator Lifecycle Manager (OLM) in your disconnected environment.
Before you can install Red Hat build of Kueue, you must complete the following steps:
- Disable the default remote OperatorHub sources for OLM.
- Use a workstation with full internet access to create and push local mirrors of the OperatorHub content to a mirror registry.
- Configure OLM to install and manage Operators from local sources on the mirror registry instead of the default remote sources.
After enabling OLM in a disconnected environment, you can continue to use your unrestricted workstation to keep your local OperatorHub sources updated as newer versions of Operators are released.
For full documentation on completing these steps, see "Using Operator Lifecycle Manager in disconnected environments".
2.4.1. Compatible environments Copy linkLink copied to clipboard!
Your cluster must meet specific architecture and platform requirements before you can install Red Hat build of Kueue.
2.4.1.1. Supported architectures Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following architectures:
- ARM64
- 64-bit x86
- ppc64le (IBM Power®)
- s390x (IBM Z®)
2.4.1.2. Supported platforms Copy linkLink copied to clipboard!
Red Hat build of Kueue version 1.1 and later is supported on the following platforms:
- OpenShift Container Platform
- Hosted control planes for OpenShift Container Platform
Currently, Red Hat build of Kueue is not supported on Red Hat build of MicroShift (MicroShift).
2.4.2. Installing the Red Hat Build of Kueue Operator Copy linkLink copied to clipboard!
You can install the Red Hat Build of Kueue Operator on a OpenShift Container Platform cluster by using the OperatorHub in the web console.
Prerequisites
- You have administrator permissions on a OpenShift Container Platform cluster.
- You have access to the OpenShift Container Platform web console.
- You have installed and configured the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Choose Red Hat Build of Kueue Operator from the list of available Operators, and click Install.
Select Enable Operator recommended cluster monitoring on this Namespace.
This option sets the
openshift.io/cluster-monitoring: "true"label in the Namespace object. You must select this option to ensure that cluster monitoring scrapes theopenshift-kueue-operatornamespace.Click Install.
NoteAlternatively, if you are creating the
Namespaceobject by using YAML, ensure that you include theopenshift.io/cluster-monitoring: "true"label:apiVersion: v1 kind: Namespace metadata: labels: openshift.io/cluster-monitoring: "true" name: openshift-kueue-operator
Verification
-
Go to Operators
Installed Operators and confirm that the Red Hat Build of Kueue Operator is listed with Status as Succeeded.
2.4.3. Upgrading Red Hat build of Kueue Copy linkLink copied to clipboard!
If you have previously installed Red Hat build of Kueue, you must manually upgrade your deployment to the latest version to use the latest bug fixes and feature enhancements.
Prerequisites
- You have installed a previous version of Red Hat build of Kueue.
- You are logged in to the OpenShift Container Platform web console with cluster administrator permissions.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators, then select Red Hat build of Kueue from the list. - From the Actions drop-down menu, select Uninstall Operator.
The Uninstall Operator? dialog box opens. Click Uninstall.
ImportantSelecting the Delete all operand instances for this operator checkbox before clicking Uninstall deletes all existing resources from the cluster, including:
-
The
KueueCR - Any cluster queues, local queues, or resource flavors that you have created
Leave this box unchecked when upgrading your cluster to retain your created resources.
-
The
-
In the OpenShift Container Platform web console, click Operators
OperatorHub. - Choose Red Hat Build of Kueue Operator from the list of available Operators, and click Install.
Verification
-
Go to Operators
Installed Operators. - Confirm that the Red Hat Build of Kueue Operator is listed with Status as Succeeded.
- Confirm that the version shown under the Operator name in the list is the latest version.
2.4.4. Creating a Kueue custom resource Copy linkLink copied to clipboard!
After you have installed the Red Hat Build of Kueue Operator, you must create a Kueue custom resource (CR) to configure your installation.
Prerequisites
Ensure that you have completed the following prerequisites:
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have cluster administrator permissions and the
kueue-batch-admin-rolerole. - You have access to the OpenShift Container Platform web console.
Procedure
-
In the OpenShift Container Platform web console, click Operators
Installed Operators. - In the Provided APIs table column, click Kueue. This takes you to the Kueue tab of the Operator details page.
- Click Create Kueue. This takes you to the Create Kueue YAML view.
Enter the details for your
KueueCR.Example
KueueCRapiVersion: kueue.openshift.io/v1 kind: Kueue metadata: labels: app.kubernetes.io/name: kueue-operator app.kubernetes.io/managed-by: kustomize name: cluster namespace: openshift-kueue-operator spec: managementState: Managed config: integrations: frameworks: - BatchJob preemption: preemptionPolicy: Classical # ...where:
metadata.name-
Specifies the name of the
KueueCR. The value must becluster. spec.config.integrations.frameworks-
Specifies the workload types to configure for Red Hat build of Kueue. The default configuration is
BatchJob. Additional types arePod,Deployment, andStatefulSet. spec.config.preemption.preemptionPolicy-
Specifies the preemption policy for Red Hat build of Kueue. Set the value to
FairSharingto configure fair sharing. The default value isClassical. This value is optional.
- Click Create.
Verification
-
After you create the
KueueCR, the web console brings you to the Operator details page, where you can see the CR in the list of Kueues. Optional: If you have the OpenShift CLI (
oc) installed, you can run the following command and observe the output to confirm that yourKueueCR has been created successfully:$ oc get kueueExample output
NAME AGE cluster 4m
2.4.5. Labeling namespaces to allow Red Hat build of Kueue to manage jobs Copy linkLink copied to clipboard!
You must add the kueue.openshift.io/managed=true label to each namespace where you want Red Hat build of Kueue to manage jobs, because the Operator only enforces policies on labeled namespaces.
Prerequisites
- You have cluster administrator permissions.
-
The Red Hat build of Kueue Operator is installed on your cluster, and you have created a
Kueuecustom resource (CR). -
You have installed the OpenShift CLI (
oc).
Procedure
Add the
kueue.openshift.io/managed=truelabel to a namespace by running the following command:$ oc label namespace <namespace> kueue.openshift.io/managed=trueWhen you add this label, you instruct the Red Hat build of Kueue Operator that the namespace is managed by its webhook admission controllers. As a result, any Red Hat build of Kueue resources within that namespace are properly validated and mutated.
2.5. Integrating the Leader Worker Set Operator Copy linkLink copied to clipboard!
You can integrate the Leader Worker Set Operator with Red Hat build of Kueue so you can leverage the scheduling and resource management functionality when running LeaderWorkerSets.
The Leader Worker Set Operator allows you to manage multi-node AI/ML inference deployments efficiently. Red Hat build of Kueue provides scheduling and resource management capabilities for these deployments. You can configure Leader Worker Set Operator to leverage these capabilities when running the LeaderWorkerSet API for deploying a group of pods as a unit of replication.
2.5.1. Installing Leader Worker Set Operator with Red Hat build of Kueue Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to work with the Leader Worker Set Operator.
Prerequisites
- You have installed Red Hat build of Kueue using the Red Hat Build of Kueue Operator in the software catalog.
- You have installed Leader Worker Set Operator and Operand in the software catalog.
-
You have cluster administrator permissions and the
kueue-batch-admin-rolerole. - You have access to the OpenShift Container Platform web console.
- You have installed the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
Add
LeaderWorkerSetto theconfig.integrations.frameworksection of the Red Hat build of Kueue cluster object, as shown in the following example:apiVersion: kueue.openshift.io/v1 kind: Kueue metadata: labels: app.kubernetes.io/name: kueue-operator app.kubernetes.io/managed-by: kustomize name: cluster namespace: openshift-kueue-operator spec: managementState: Managed config: integrations: frameworks: - BatchJob - LeaderWorkerSet
2.5.2. Running Leader Worker Set Operator with Red Hat build of Kueue Copy linkLink copied to clipboard!
You can add and run the Leader Worker Set Operator to your existing frameworks.
Prerequisites
- Red Hat build of Kueue using the Red Hat Build of Kueue Operator is installed.
- Leader Worker Set Operator and Operand are installed.
- The cert-manager Operator for Red Hat OpenShift is installed.
-
The
namespacewhereLeaderWorkerSetwill be created is labeled usingkueue.openshift.io/managed=true. Ensure that the following objects have been configured:
-
ClusterQueue -
ResourceFlavor -
LocalQueue -
Namespace
-
Procedure
Create a file named
leaderworkerset.yaml.Example of a
LeaderWorkerSetapiVersion: leaderworkerset.x-k8s.io/v1 kind: LeaderWorkerSet metadata: generation: 1 name: my-lws namespace: my-namespace spec: leaderWorkerTemplate: leaderTemplate: metadata: {} spec: containers: - image: nginxinc/nginx-unprivileged:1.27 name: leader resources: {} restartPolicy: RecreateGroupOnPodRestart size: 3 workerTemplate: metadata: {} spec: containers: - image: nginxinc/nginx-unprivileged:1.27 name: worker ports: - containerPort: 8080 protocol: TCP resources: {} networkConfig: subdomainPolicy: Shared replicas: 2 rolloutStrategy: rollingUpdateConfiguration: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate startupPolicy: LeaderCreatedSpecify the target local queue in the
metadata.labelssection of theLeaderWorkerSetconfiguration.metadata: labels: kueue.x-k8s.io/queue-name: user-queueApply the leader worker set configuration by running the following command:
$ oc apply -f leaderworkerset.yaml
2.6. Integrating the JobSet Operator Copy linkLink copied to clipboard!
You can integrate JobSet Operator with Red Hat build of Kueue so you can leverage the scheduling and resource management functionality provided by Red Hat build of Kueue when running the JobSet Operator.
You can use the JobSet Operator to manage and run large-scale, coordinated workloads like high-performance computing (HPC) and AI training.
The JobSet Operator models a distributed batch workload as a group of Kubernetes Jobs. This allows you to easily specify different pod templates for different distinct groups of pods, for example, a leader, workers, parameter servers, and so on.
2.6.1. Installing JobSet Operator with Red Hat build of Kueue Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to work with the JobSet Operator.
Prerequisites
- You have installed Red Hat build of Kueue using the Red Hat Build of Kueue Operator in the software catalog.
- You have installed JobSet Operator in the software catalog.
-
You have cluster administrator permissions and the
kueue-batch-admin-rolerole. - You have access to the OpenShift Container Platform web console.
- You have installed the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
Add
JobSetto theconfig.integrations.frameworkssection of the Red Hat build of Kueue cluster object, as shown in the following example:apiVersion: kueue.openshift.io/v1 kind: Kueue metadata: name: cluster namespace: openshift-kueue-operator spec: managementState: Managed config: integrations: frameworks: - JobSet
2.6.2. Running JobSet Operator with Red Hat build of Kueue Copy linkLink copied to clipboard!
You can add and run JobSet Operator to your existing frameworks.
Prerequisites
- Red Hat build of Kueue using the Red Hat Build of Kueue Operator is installed.
- JobSet Operator is installed.
- The cert-manager Operator for Red Hat OpenShift is installed.
-
The
namespacewhereJobSetwill be created is labeled usingkueue.openshift.io/managed=true. Ensure that the following objects have been configured:
-
ClusterQueue -
ResourceFlavor -
LocalQueue -
Namespace
-
Procedure
Create a file named
jobset.yaml.Example of a
JobSetapiVersion: jobset.x-k8s.io/v1alpha2 kind: JobSet metadata: name: jobset namespace: my-namespace spec: replicatedJobs: - name: workers replicas: 1 template: spec: parallelism: 3 completions: 3 backoffLimit: 1 template: spec: containers: - name: sleep image: busybox resources: requests: cpu: 200m memory: "200Mi" command: - sleep args: - 220s - name: driver template: spec: parallelism: 1 completions: 1 backoffLimit: 0 template: spec: containers: - name: sleep image: busybox resources: requests: cpu: 200m memory: "200Mi" command: - sleep args: - 220sSpecify the target local queue in the
metadata.labelssection of theJobSetconfiguration.metadata: labels: kueue.x-k8s.io/queue-name: <local-queue-name>Apply the JobSet configuration by running the following command:
$ oc apply -f jobset.yaml
2.7. Integrating Dynamic Resource Allocation Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to manage quota for workloads that use Dynamic Resource Allocation (DRA) to request GPUs. When DRA quota management is configured, Red Hat build of Kueue counts DRA device requests toward quota in the same way that it counts traditional resources such as CPU and memory.
Kueue integration with Dynamic Resource Allocation (DRA) is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
If DRA device quota is not configured, Red Hat build of Kueue does not account for GPU requests when admitting workloads, which can result in teams exceeding their GPU allocation.
2.7.1. DRA quota management overview Copy linkLink copied to clipboard!
Dynamic Resource Allocation (DRA) is a Kubernetes framework that provides structured discovery and allocation of specialized hardware such as GPUs. DRA drivers publish device information through ResourceSlice objects, and administrators group devices into categories using DeviceClass objects.
Without Red Hat build of Kueue DRA integration, GPU requests made through DRA are invisible to quota management. Red Hat build of Kueue cannot account for these requests when admitting workloads, which can result in teams exceeding their GPU allocation.
Red Hat build of Kueue provides two approaches for managing DRA device quota:
ResourceClaimTemplate-
The default approach. Workloads explicitly reference a
ResourceClaimTemplateobject that defines device requirements. Administrators configuredeviceClassMappingsin the Kueue CR to map eachDeviceClassobject to a logical resource name for quota tracking. Use this approach when workloads need fine-grained control over device selection, such as targeting a specific GPU model or architecture using CEL selectors. Extended resourcesA simplified alternative that allows workloads to use standard Kubernetes
resources.requestssyntax, for example,nvidia.com/gpu: "1", instead of explicitly creating DRA objects. When aDeviceClassobject includes thespec.extendedResourceNamefield, the Kubernetes scheduler automatically generatesResourceClaimobjects. Use this approach when you want the simplest possible user experience and backward compatibility with existing workload YAML.NoteIf a
DeviceClassobject with theextendedResourceNamefield also appears in adeviceClassMappingsentry, Red Hat build of Kueue uses the mapped logical name from thedeviceClassMappingsentry for quota instead of the extended resource name, unifying quota accounting across both paths.
For clusters with partitionable devices, such as NVIDIA Multi-Instance GPU (MIG), Red Hat build of Kueue can also charge quota in capacity units, such as GPU memory, rather than device count. Partitionable devices use ResourceClaimTemplates objects with CEL selectors to target specific partition profiles, and require administrators to configure counter-based sources in deviceClassMappings. This capability requires OpenShift Container Platform 4.22 or later.
2.7.1.1. Configuring the resource claim template path Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to manage quota for workloads that explicitly reference ResourceClaimTemplate objects. This requires configuring the deviceClassMappings entry in the Red Hat build of Kueue custom resource (CR) and adding the DRA resource to your ClusterQueue object.
Prerequisites
- You have installed Red Hat build of Kueue by using the Red Hat Build of Kueue Operator.
-
You have created a
Kueuecustom resource (CR). - Your cluster is running OpenShift Container Platform 4.21 or later.
A DRA driver is installed in the cluster, for example,
nvidia-dra-driver. You can verify that the DRA driver is publishing device information by running the following command:$ oc get resourceslicesIf the command returns one or more
ResourceSliceobjects, the DRA driver is running.At least one
DeviceClassobject exists in the cluster. You can verify this by running the following command:$ oc get deviceclass
Procedure
Use the following command to add a
deviceClassMappingsentry to the Red Hat build of Kueue configuration that maps eachDeviceClassto a logical resource name for quota:$ oc patch kueue cluster -n openshift-kueue-operator --type=merge -p '{ "spec": { "config": { "resources": { "deviceClassMappings": [{ "name": "nvidia.com/gpu", "deviceClassNames": ["gpu.nvidia.com"] }] } } } }'Replace
"nvidia.com/gpu"with the resource name used inClusterQueuequotas andWorkloadstatus.Replace
"gpu.nvidia.com"with one or moreDeviceClassnames that map to this resource.Multiple device classes can map to the same logical resource name. For example, if you have separate device classes for different GPU models but want a single quota pool, as shown in the following example:
resources: deviceClassMappings: - name: nvidia.com/gpu deviceClassNames: - gpu-a100.nvidia.com - gpu-h100.nvidia.comCreate a file called
rct-queues.yamlthat contains the following content:Example quota configuration for a
ResourceClaimTemplateobjectapiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: "default-flavor" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: "cluster-queue" spec: namespaceSelector: {} resourceGroups: - coveredResources: ["cpu", "memory", "nvidia.com/gpu"] flavors: - name: "default-flavor" resources: - name: "cpu" nominalQuota: 40 - name: "memory" nominalQuota: 200Gi - name: "nvidia.com/gpu" nominalQuota: 8 --- apiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: "default" name: "user-queue" spec: clusterQueue: "cluster-queue"Apply the
rct-queues.yamlfile:$ oc apply -f rct-queues.yamlCreate a
ResourceClaimTemplateobject and a workload to verify the configuration. Create a file calledrct-job.yamlby running the following command:$ oc create -f rct-job.yamlExample
ResourceClaimTemplateworkloadapiVersion: resource.k8s.io/v1 kind: ResourceClaimTemplate metadata: name: my-gpu namespace: default spec: spec: devices: requests: - name: gpu exactly: deviceClassName: gpu.nvidia.com --- apiVersion: batch/v1 kind: Job metadata: generateName: rct-test-job- namespace: default labels: kueue.x-k8s.io/queue-name: user-queue spec: template: spec: restartPolicy: Never resourceClaims: - name: gpu resourceClaimTemplateName: my-gpu containers: - name: worker image: registry.k8s.io/e2e-test-images/agnhost:2.53 args: ["pause"] resources: claims: - name: gpu requests: cpu: "1" memory: "200Mi"where:
spec.spec.drivers.requests.exactly.deviceClassName:-
References the
DeviceClassobject configured in thedeviceClassMappingsentry. metadata.labels.kueue.x-k8s.io/queue-name:- Identifies the local queue to submit the job to.
spec.template.spec.resourceClaims.resourceClaimTemplateName:-
References the
ResourceClaimTemplateobject defined above. The template must exist in the same namespace as the job. spec.template.spec.containers.resources.claims.name:- Attaches the resource claim to this container.
Verification
Verify that the workload has been created and admitted:
$ oc -n default get workloadsVerify that a
ResourceClaimobject was created from the template:$ oc -n default get resourceclaimsIf the workload is not admitted, verify the following:
Check if the namespace is managed by Red Hat build of Kueue:
$ oc label namespace default kueue.openshift.io/managed=true-
The
deviceClassMappingsin theKueueCR maps theDeviceClassobject to the resource name in thecoveredResourcesparameter. -
The
ClusterQueueobject has sufficient quota available. -
The
ResourceClaimTemplateobject exists in the same namespace as the job.
2.7.1.2. Configuring the extended resources path Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to manage quota for workloads that request GPUs by using the standard resources.requests syntax, for example, nvidia.com/gpu: "1".
When a DeviceClass object includes the spec.extendedResourceName field, the Kubernetes scheduler automatically generates ResourceClaim objects. This path does not require deviceClassMappings configuration because Red Hat build of Kueue auto-discovers the mapping by indexing DeviceClass objects.
The Red Hat build of Kueue Operator automatically enables the required Red Hat build of Kueue feature gates when it detects the DRAExtendedResource Kubernetes feature gate on the cluster. No manual Red Hat build of Kueue feature gate configuration is required.
To use the extended resources path, you must enable the DRAExtendedResource Kubernetes feature gate. This feature is expected to be generally available in a future OpenShift Container Platform release.
Prerequisites
- You have cluster administrator permissions.
- You have installed Red Hat build of Kueue by using the Red Hat Build of Kueue Operator.
-
You have created a
KueueCR. - Your cluster is running OpenShift Container Platform 4.21 or later.
A DRA driver is installed in the cluster, for example,
nvidia-dra-driver. You can verify that the DRA driver is publishing device information by running the following command:$ oc get resourceslicesIf the command returns one or more
ResourceSliceobjects, the DRA driver is running.At least one
DeviceClassobject exists in the cluster. You can verify this by running the following command:$ oc get deviceclassYou have enabled the
DRAExtendedResourceKubernetes feature gate by adding theCustomNoUpgradefeature set to theFeatureGateCR namedcluster, as shown in the following example:apiVersion: config.openshift.io/v1 kind: FeatureGate metadata: name: cluster spec: featureSet: CustomNoUpgrade customNoUpgrade: enabled: - DRAExtendedResourceWarningEnabling the
CustomNoUpgradefeature set on your cluster cannot be undone and prevents minor version updates. This feature set is not supported on production clusters.
Procedure
Verify that the
DeviceClassobject hasspec.extendedResourceNameset by running the following command:$ oc get deviceclass gpu.nvidia.com -o jsonpath='{.spec.extendedResourceName}'Example output
nvidia.com/gpuIf the command does not return a value, add the
extendedResourceNamefield by running the following command:$ oc patch deviceclass gpu.nvidia.com --type=merge -p '{"spec":{"extendedResourceName":"nvidia.com/gpu"}}'Create a
ClusterQueueobject that includes the GPU resource in thecoveredResourcesparameter by creating a file calleder-queues.yaml, as shown in the following example:Example quota configuration for extended resources
apiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: "default-flavor" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: "cluster-queue" spec: namespaceSelector: {} resourceGroups: - coveredResources: ["cpu", "memory", "nvidia.com/gpu"] flavors: - name: "default-flavor" resources: - name: "cpu" nominalQuota: 40 - name: "memory" nominalQuota: 200Gi - name: "nvidia.com/gpu" nominalQuota: 8 --- apiVersion: v1 kind: Namespace metadata: name: team-a labels: kueue.openshift.io/managed: "true" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: "team-a" name: "user-queue" spec: clusterQueue: "cluster-queue"Apply the quota configuration by running the following command:
$ oc apply -f er-queues.yamlCreate a workload that uses the standard resource request syntax by creating a file called
er-job.yaml, as shown in the following example:Example workload using extended resources
apiVersion: batch/v1 kind: Job metadata: name: er-test-job namespace: team-a labels: kueue.x-k8s.io/queue-name: user-queue spec: template: spec: containers: - name: worker image: registry.k8s.io/e2e-test-images/agnhost:2.53 args: ["pause"] resources: requests: cpu: "1" memory: "200Mi" nvidia.com/gpu: "1" limits: nvidia.com/gpu: "1" restartPolicy: Neverwhere:
metadata.labels.kueue.x-k8s.io/queue-name- Identifies the local queue to submit the job to.
spec.template.spec.containers.resources.requests.cpu.nvidia.com/gpu-
Requests a GPU by using the standard extended resource syntax. No
ResourceClaimTemplateorresourceClaimssection is needed. TheDeviceClassobject with thespec.extendedResourceNamefield causes the Kubernetes scheduler to generate aResourceClaimobject automatically. spec.template.spec.containers.resources.limits.cpu.nvidia.com/gpu-
Replace
"1"with a GPU by using the standard extended resource syntax. NoResourceClaimTemplateorresourceClaimssection is needed. TheDeviceClassobject with thespec.extendedResourceNamefield causes the Kubernetes scheduler to generate aResourceClaimobject automatically.
Create the workload by running the following command:
$ oc apply -f er-job.yaml
Verification
Verify that a workload has been created and admitted by running the following command:
$ oc -n team-a get workloadsExample output
NAME QUEUE RESERVED IN ADMITTED AGE job-er-test-job-4m2x-d3f4g user-queue cluster-queue True 10sVerify that a
ResourceClaimwas automatically created by running the following command:$ oc -n team-a get resourceclaimsExample output
NAME STATE AGE er-test-job-jj7vz-extended-resources-bggzk allocated,reserved 24sThe Kubernetes scheduler creates a
ResourceClaimfor each pod that requests an extended resource backed by aDeviceClass.If the workload is not admitted, verify the following:
-
The
DRAExtendedResourceKubernetes feature gate is enabled on the cluster. -
The
DeviceClasshasspec.extendedResourceNameset. -
The
ClusterQueueincludes the extended resource name incoveredResources. -
The
ClusterQueuehas sufficient quota available.
-
The
2.7.1.3. Configuring the partitionable devices Copy linkLink copied to clipboard!
You can configure Red Hat build of Kueue to manage quota for partitionable devices based on actual device capacity rather than device count. Partitionable devices, such as NVIDIA Multi-Instance GPU (MIG) capable GPUs, allow a single GPU to be dynamically subdivided into smaller partitions.
When counter-based quota is configured, Red Hat build of Kueue charges quota in capacity units such as GPU memory rather than counting whole devices. For example, a 1g.5gb MIG partition on an A100-40GB charges 4864Mi of GPU memory quota, while a whole GPU charges 40320Mi.
To use partitionable devices, your cluster must be running OpenShift Container Platform 4.22 or later and must have the CustomNoUpgrade feature set enabled with explicit DRAPartitionableDevices gate enablement.
Prerequisites
- You have cluster administrator permissions.
- You have installed Red Hat build of Kueue by using the Red Hat Build of Kueue Operator.
-
You have created a
Kueuecustom resource (CR). - Your cluster is running OpenShift Container Platform 4.22 or later.
A DRA driver that publishes
consumesCountersinResourceSliceobjects is installed, for example,nvidia-dra-driver. You can verify that the DRA driver is publishing device information by running the following command:$ oc get resourceslicesIf the command returns one or more
ResourceSliceobjects, the DRA driver is running.At least one
DeviceClassobject exists in the cluster. You can verify this by running the following command:$ oc get deviceclass- MIG is enabled on the GPU hardware.
You have enabled the
DRAPartitionableDevicesKubernetes feature gate by adding theCustomNoUpgradefeature set to theFeatureGateCR namedcluster, as shown in the following example:apiVersion: config.openshift.io/v1 kind: FeatureGate metadata: name: cluster spec: featureSet: CustomNoUpgrade customNoUpgrade: enabled: - DRAPartitionableDevicesWarningEnabling the
CustomNoUpgradefeature set on your cluster cannot be undone and prevents minor version updates. This feature set is not supported on production clusters. For information about enabling feature gates, see "Enabling features using feature gates".
Procedure
Verify that your DRA driver publishes counter data by running the following command:
$ oc get resourceslices -o jsonpath='{range .items[*]}{.spec.driver}{"\t"}{range .spec.devices[*]}{.name}: {.consumesCounters}{"\n"}{end}{end}'Example output
gpu.nvidia.com gpu-0: [{"counterSet":"shared","counters":{"memory":{"value":"40Gi"}}}]If the output does not show
consumesCountersdata, verify that your DRA driver version supports partitionable devices and that MIG is enabled on the GPU hardware.Configure counter-based quota by adding a
deviceClassMappingsentry with asourcessection to theconfig.resourcessection of the Red Hat build of Kueue CR, as shown in the following example:apiVersion: kueue.openshift.io/v1 kind: Kueue metadata: name: cluster namespace: openshift-kueue-operator spec: config: resources: deviceClassMappings: - name: gpu.memory deviceClassNames: - gpu.nvidia.com - mig.nvidia.com sources: - type: Counter counter: name: memory driver: gpu.nvidia.com deviceSelector: type: CEL cel: expression: "device.driver == 'gpu.nvidia.com'" # ...where:
spec.config.resources.deviceClassMappings.name-
The logical resource name used in
ClusterQueuequotas. When counter-based sources are configured, quota is charged in capacity units rather than device count. spec.config.resources.deviceClassMappings.deviceClassNames-
The
DeviceClassnames that map to this resource. Include both the whole-GPU class (gpu.nvidia.com) and the MIG class (mig.nvidia.com). spec.config.resources.deviceClassMappings.sources- Defines how Red Hat build of Kueue computes the quota charge.
spec.config.resources.deviceClassMappings.sources.counter.name-
The counter name must match a counter key published by the DRA driver in
ResourceSlicedevices. spec.config.resources.deviceClassMappings.sources.counter.deviceSelectorScopes which devices are eligible for counter-based quota accounting.
NoteThe Red Hat build of Kueue Operator automatically enables the required Red Hat build of Kueue feature gates when it detects the
DRAPartitionableDevicesKubernetes feature gate andsourcesare configured indeviceClassMappings. No manual Red Hat build of Kueue feature gate configuration is required.
Create a
ClusterQueueobject with counter-based quota. Set the quota in capacity units rather than device count. Create a file calledpd-queues.yamlwith the following content:Example quota configuration for partitionable devices
apiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: "default-flavor" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: "cluster-queue" spec: namespaceSelector: {} resourceGroups: - coveredResources: ["cpu", "memory", "gpu.memory"] flavors: - name: "default-flavor" resources: - name: "cpu" nominalQuota: 40 - name: "memory" nominalQuota: 200Gi - name: "gpu.memory" nominalQuota: 800Gi --- apiVersion: v1 kind: Namespace metadata: name: team-a labels: kueue.openshift.io/managed: "true" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: "team-a" name: "user-queue" spec: clusterQueue: "cluster-queue"where:
spec.resourceGroups.coveredResources-
The
gpu.memoryentry must match thenamevalue indeviceClassMappings. spec.resourceGroups.flavors.resources.nameSpecify
"gpu.memory"to set the total GPU memory quota. For example,800Giaccommodates twenty A100-40GB GPUs or equivalent MIG partitions.NoteWhen
ClusterQueueobjects share a cohort, ensure all queues use the same unit scale for counter resources. Red Hat build of Kueue does not validate unit consistency acrossClusterQueueobjects.
Apply the quota configuration by running the following command:
$ oc apply -f pd-queues.yamlCreate a workload that requests a MIG partition by creating a file called
pd-job.yaml, as shown in the following example:Example workload requesting a MIG partition
apiVersion: resource.k8s.io/v1 kind: ResourceClaimTemplate metadata: namespace: team-a name: gpu-partition spec: spec: devices: requests: - name: gpu exactly: deviceClassName: mig.nvidia.com count: 1 selectors: - cel: expression: "device.attributes['gpu.nvidia.com'].profile == '1g.5gb'" --- apiVersion: batch/v1 kind: Job metadata: generateName: pd-test-job namespace: team-a labels: kueue.x-k8s.io/queue-name: user-queue spec: template: spec: containers: - name: worker image: registry.k8s.io/e2e-test-images/agnhost:2.53 args: ["pause"] resources: claims: - name: gpu requests: cpu: "1" memory: "200Mi" resourceClaims: - name: gpu resourceClaimTemplateName: gpu-partition restartPolicy: Neverwhere:
spec.spec.devices.requests.exactly.deviceClassName-
References the MIG
DeviceClass. spec.spec.devices.requests.exactly.selectors.cel.expression:-
Selects a specific MIG partition profile. Available profiles depend on the GPU model, for example,
1g.5gb,2g.10gb,3g.20gb, or7g.40gbfor the A100-40GB. metadata.labels.kueue.x-k8s.io/queue-name:- Identifies the local queue to submit the job to.
spec.template.spec.resourceClaims.resourceClaimTemplateName:-
References the
ResourceClaimTemplatedefined above. TheResourceClaimTemplatemust exist in the same namespace as the job.
Create the workload by running the following command:
$ oc create -f pd-job.yaml
Verification
Verify that the workload is admitted and that quota was charged in capacity units by running the following command:
$ oc -n team-a get workloads -o jsonpath='{range .items[*]}{.metadata.name}: {.status.admission.podSetAssignments[0].resourceUsage}{"\n"}{end}'Example output
job-pd-test-job-xxxxx: {"cpu":"1","gpu.memory":"5100273664","memory":"200Mi"}The
gpu.memoryvalue reflects the actual memory capacity of the requested MIG partition rather than a device count of1.If the workload is not admitted, verify the following:
-
The
DRAPartitionableDevicesKubernetes feature gate is enabled on the cluster. -
The
namevalue of thedeviceClassMappingsobject matches the resource name incoveredResources. -
The
counter.nameinsourcesmatches a counter key in theResourceSliceobjects. -
The
ClusterQueuehas sufficient GPU memory quota for the requested partition size. - MIG is enabled on the GPU hardware.
-
The
2.8. Configuring role-based permissions Copy linkLink copied to clipboard!
You can configure role-based access control (RBAC) for your Red Hat build of Kueue deployment to control which users can create specific Red Hat build of Kueue objects.
2.8.1. Cluster roles Copy linkLink copied to clipboard!
The Red Hat build of Kueue Operator deploys kueue-batch-admin-role and kueue-batch-user-role cluster roles by default.
- kueue-batch-admin-role
- This cluster role includes the permissions to manage cluster queues, local queues, workloads, and resource flavors.
- kueue-batch-user-role
- This cluster role includes the permissions to manage jobs and to view local queues and workloads.
2.8.2. Configuring permissions for batch administrators Copy linkLink copied to clipboard!
You can configure permissions for batch administrators by binding the kueue-batch-admin-role cluster role to a user or group of users.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
- You have cluster administrator permissions.
-
You have installed the OpenShift CLI (
oc).
Procedure
Create a
ClusterRoleBindingobject as a YAML file:Example
ClusterRoleBindingobjectapiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: kueue-admins subjects: - kind: User name: admin@example.com apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: kueue-batch-admin-role apiGroup: rbac.authorization.k8s.iowhere:
metadata.name-
Specifies the name of the
ClusterRoleBindingobject. subjects- Specifies the user or group of users you want to provide user permissions for.
roleRef-
Specifies the
kueue-batch-admin-rolecluster role.
Apply the
ClusterRoleBindingobject:$ oc apply -f <filename>.yaml
Verification
You can verify that the
ClusterRoleBindingobject was applied correctly by running the following command and verifying that the output contains the correct information for thekueue-batch-admin-rolecluster role:$ oc describe clusterrolebinding.rbacExample output
... Name: kueue-batch-admin-role Labels: app.kubernetes.io/name=kueue Annotations: <none> Role: Kind: ClusterRole Name: kueue-batch-admin-role Subjects: Kind Name Namespace ---- ---- --------- User admin@example.com admin-namespace ...
2.8.3. Configuring permissions for users Copy linkLink copied to clipboard!
You can configure permissions for Red Hat build of Kueue users by binding the kueue-batch-user-role cluster role to a user or group of users.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
- You have cluster administrator permissions.
-
You have installed the OpenShift CLI (
oc).
Procedure
Create a
RoleBindingobject as a YAML file:Example
ClusterRoleBindingobjectapiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kueue-users namespace: user-namespace subjects: - kind: Group name: team-a@example.com apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: kueue-batch-user-role apiGroup: rbac.authorization.k8s.iowhere:
metadata.name-
Specifies the name of the
RoleBindingobject. metadata.namespace-
Specifies the namespace the
RoleBindingobject applies to. subjects- Specifies the user or group of users you want to provide user permissions for.
roleRef-
Specifies the
kueue-batch-user-rolecluster role.
Apply the
RoleBindingobject:$ oc apply -f <filename>.yaml
Verification
You can verify that the
RoleBindingobject was applied correctly by running the following command and verifying that the output contains the correct information for thekueue-batch-user-rolecluster role:$ oc describe rolebinding.rbacExample output
... Name: kueue-users Labels: app.kubernetes.io/name=kueue Annotations: <none> Role: Kind: ClusterRole Name: kueue-batch-user-role Subjects: Kind Name Namespace ---- ---- --------- Group team-a@example.com user-namespace ...
2.9. Configuring quotas Copy linkLink copied to clipboard!
As an administrator, you can use Red Hat build of Kueue to configure quotas to optimize resource allocation and system throughput for user workloads. You can configure quotas for compute resources such as CPU, memory, pods, and GPU.
You can configure quotas in Red Hat build of Kueue by completing the following steps:
- Configure a cluster queue.
- Configure a resource flavor.
- Configure a local queue.
Users can then submit their workloads to the local queue.
2.9.1. Configuring a cluster queue Copy linkLink copied to clipboard!
A cluster queue is a cluster-scoped resource, represented by a ClusterQueue object, that governs a pool of resources such as CPU, memory, and pods. Cluster queues can be used to define usage limits, quotas for resource flavors, order of consumption, and fair sharing rules.
The cluster queue is not ready for use until a ResourceFlavor object has also been configured.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have cluster administrator permissions or the
kueue-batch-admin-rolerole. -
You have installed the OpenShift CLI (
oc).
Procedure
Create a
ClusterQueueobject as a YAML file:Example of a basic
ClusterQueueobject using a single resource flavorapiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: cluster-queue spec: namespaceSelector: {}1 resourceGroups: - coveredResources: ["cpu", "memory", "pods", "foo.com/gpu"]2 flavors: - name: "default-flavor"3 resources:4 - name: "cpu" nominalQuota: 9 - name: "memory" nominalQuota: 36Gi - name: "pods" nominalQuota: 5 - name: "foo.com/gpu" nominalQuota: 100- 1
- Defines which namespaces can use the resources governed by this cluster queue. An empty
namespaceSelectoras shown in the example means that all namespaces can use these resources. - 2
- Defines the resource types governed by the cluster queue. This example
ClusterQueueobject governs CPU, memory, pod, and GPU resources. - 3
- Defines the resource flavor that is applied to the resource types listed. In this example, the
default-flavorresource flavor is applied to CPU, memory, pod, and GPU resources. - 4
- Defines the resource requirements for admitting jobs. This example cluster queue only admits jobs if the following conditions are met:
- The sum of the CPU requests is less than or equal to 9.
- The sum of the memory requests is less than or equal to 36Gi.
- The total number of pods is less than or equal to 5.
- The sum of the GPU requests is less than or equal to 100.
Apply the
ClusterQueueobject by running the following command:$ oc apply -f <filename>.yaml
2.9.2. Configuring a resource flavor Copy linkLink copied to clipboard!
After you have configured a ClusterQueue object, you can configure a ResourceFlavor object.
Resources in a cluster are typically not homogeneous. If the resources in your cluster are homogeneous, you can use an empty ResourceFlavor instead of adding labels to custom resource flavors.
You can use a custom ResourceFlavor object to represent different resource variations that are associated with cluster nodes through labels, taints, and tolerations. You can then associate workloads with specific node types to enable fine-grained resource management.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have cluster administrator permissions or the
kueue-batch-admin-rolerole. -
You have installed the OpenShift CLI (
oc).
Procedure
Create a
ResourceFlavorobject as a YAML file:Example of an empty
ResourceFlavorobjectapiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: default-flavorExample of a custom
ResourceFlavorobjectapiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: "x86" spec: nodeLabels: cpu-arch: x86Apply the
ResourceFlavorobject by running the following command:$ oc apply -f <filename>.yaml
2.9.3. Configuring a local queue Copy linkLink copied to clipboard!
A local queue is a namespaced object, represented by a LocalQueue object, that groups closely related workloads that belong to a single namespace.
As an administrator, you can configure a LocalQueue object to point to a cluster queue. This allocates resources from the cluster queue to workloads in the namespace specified in the LocalQueue object.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have cluster administrator permissions or the
kueue-batch-admin-rolerole. -
You have installed the OpenShift CLI (
oc). -
You have created a
ClusterQueueobject.
Procedure
Create a
LocalQueueobject as a YAML file:Example of a basic
LocalQueueobjectapiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: team-namespace name: user-queue spec: clusterQueue: cluster-queueApply the
LocalQueueobject by running the following command:$ oc apply -f <filename>.yaml
2.9.4. Configuring a default local queue Copy linkLink copied to clipboard!
As a cluster administrator, you can improve quota enforcement in your cluster by managing all jobs in selected namespaces without needing to explicitly label each job. You can do this by creating a default local queue.
A default local queue serves as the local queue for newly created jobs that do not have the kueue.x-k8s.io/queue-name label. After you create a default local queue, any new jobs created in the namespace without a kueue.x-k8s.io/queue-name label automatically update to have the kueue.x-k8s.io/queue-name: default label.
Preexisting jobs in a namespace are not affected when you create a default local queue. If jobs already exist in the namespace before you create the default local queue, you must label those jobs explicitly to assign them to a queue.
Prerequisites
- You have installed Red Hat build of Kueue version 1.1 on your cluster.
-
You have cluster administrator permissions or the
kueue-batch-admin-rolerole. -
You have installed the OpenShift CLI (
oc). -
You have created a
ClusterQueueobject.
Procedure
Create a
LocalQueueobject nameddefaultas a YAML file:Example of a default
LocalQueueobjectapiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: team-namespace name: default spec: clusterQueue: cluster-queueApply the
LocalQueueobject by running the following command:$ oc apply -f <filename>.yaml
Verification
- Create a job in the same namespace as the default local queue.
-
Observe that the job updates with the
kueue.x-k8s.io/queue-name: defaultlabel.
2.10. Managing jobs and workloads Copy linkLink copied to clipboard!
When you create jobs in your cluster, Red Hat build of Kueue represents each job as a Workload object to track resource requirements, decisions, and statuses.
Red Hat build of Kueue does not directly manipulate your jobs. Instead, Red Hat build of Kueue manages Workload objects that represent the resource requirements of a job, and syncs any decisions and statuses between the two objects.
2.10.1. Labeling namespaces to allow Red Hat build of Kueue to manage jobs Copy linkLink copied to clipboard!
You must add the kueue.openshift.io/managed=true label to each namespace where you want Red Hat build of Kueue to manage jobs, because the Operator only enforces policies on labeled namespaces.
Prerequisites
- You have cluster administrator permissions.
-
The Red Hat build of Kueue Operator is installed on your cluster, and you have created a
Kueuecustom resource (CR). -
You have installed the OpenShift CLI (
oc).
Procedure
Add the
kueue.openshift.io/managed=truelabel to a namespace by running the following command:$ oc label namespace <namespace> kueue.openshift.io/managed=trueWhen you add this label, you instruct the Red Hat build of Kueue Operator that the namespace is managed by its webhook admission controllers. As a result, any Red Hat build of Kueue resources within that namespace are properly validated and mutated.
2.10.2. Configuring label policies for jobs Copy linkLink copied to clipboard!
You can configure the spec.config.workloadManagement.labelPolicy field in the Kueue CR to control whether Red Hat build of Kueue manages or ignores specific jobs.
The allowed values are QueueName, None, and empty ("").
If the labelPolicy setting is omitted or empty (""), the default policy is that Red Hat build of Kueue manages jobs that have a kueue.x-k8s.io/queue-name label, and ignores jobs that do not have the kueue.x-k8s.io/queue-name label. This is the same workflow as if the labelPolicy is set to QueueName.
If the labelPolicy setting is set to None, jobs are managed by Red Hat build of Kueue even if they do not have the kueue.x-k8s.io/queue-name label.
Example workloadManagement spec configuration
apiVersion: kueue.openshift.io/v1
kind: Kueue
metadata:
labels:
app.kubernetes.io/name: kueue-operator
app.kubernetes.io/managed-by: kustomize
name: cluster
namespace: openshift-kueue-operator
spec:
config:
workloadManagement:
labelPolicy: QueueName
# ...
Example user-created Job object containing the kueue.x-k8s.io/queue-name label
apiVersion: batch/v1
kind: Job
metadata:
generateName: sample-job-
namespace: my-namespace
labels:
kueue.x-k8s.io/queue-name: user-queue
spec:
# ...
2.11. Monitoring pending workloads Copy linkLink copied to clipboard!
Red Hat build of Kueue provides the VisibilityOnDemand feature to monitor pending workloads. A workload is an application that runs to completion. It can be composed by one or multiple pods that, loosely or tightly coupled, as a whole, complete a task. A workload is the unit of admission in Red Hat build of Kueue.
The VisibilityOnDemand feature provides the ability for batch administrators to monitor the pipeline of pending jobs in the cluster queue and the local queue and batch users just for local queue, and help users to estimate when their jobs will start.
You can regulate inbound requests and high request volumes, and provide user permissions for viewing the pending workloads.
2.11.1. API Priority and Fairness Copy linkLink copied to clipboard!
Red Hat build of Kueue uses Kubernetes API Priority and Fairness (APF) To help manage pending workloads. APF is a flow control mechanism that allows you to define API-level policies to regulate inbound requests to the API server. It protects the API server from being overwhelmed by unexpectedly high request volume, while protecting critical traffic from the throttling effect on best-effort workloads.
2.11.2. Providing user permissions Copy linkLink copied to clipboard!
You can configure role-based access control (RBAC) objects for the users of your Red Hat build of Kueue deployment. These objects determine which types of users can create which types of Red Hat build of Kueue objects.
You need to provide permissions to the users that require access to the specific APIs.
-
If the user needs access to the pending workloads from the
ClusterQueueresource, aClusterRoleBindingschema needs to be created referencing the ClusterRolekueue-batch-admin-role. -
If the user needs access to the pending workloads from the
LocalQueueresource, aRoleBindingschema needs to be created referencing the ClusterRolekueue-batch-user-role.
2.11.3. Monitoring pending workloads on demand Copy linkLink copied to clipboard!
To test the monitoring of pending workloads, you must correctly configure both the ClusterQueue and the LocalQueue resources. After that, you can create jobs on that LocalQueue. Kueue manages the workload object created from the job so, when a job is submitted and saturates the ClusterQueue, its corresponding workloads can be seen in the list of pending workloads.
Prerequisites
- You have cluster administrator permissions.
-
The Red Hat build of Kueue Operator is installed on your cluster, and you have created a
Kueuecustom resource (CR). -
You have installed the OpenShift CLI (
oc). -
The OpenShift CLI (
oc) has communication with your cluster.
The following procedure tells you how to install and test workload monitoring.
Procedure
Create the assets by running the following command:
cat <<EOF| oc create -f - --- apiVersion: kueue.x-k8s.io/v1beta2 kind: ResourceFlavor metadata: name: "default-flavor" --- apiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: "cluster-queue" spec: namespaceSelector: {} # match all. resourceGroups: - coveredResources: ["cpu", "memory"] flavors: - name: "default-flavor" resources: - name: "cpu" nominalQuota: 9 - name: "memory" nominalQuota: 36Gi --- apiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: namespace: "default" name: "user-queue" spec: clusterQueue: "cluster-queue" --- EOFCreate the following file with the job manifest:
cat >> job.yaml << EOF apiVersion: batch/v1 kind: Job metadata: generateName: sample-job- namespace: default labels: kueue.x-k8s.io/queue-name: user-queue spec: parallelism: 3 completions: 3 suspend: true template: spec: containers: - name: <example-job> image: registry.k8s.io/e2e-test-images/agnhost:2.53 command: [ "/bin/sh" ] args: [ "-c", "sleep 60" ] resources: requests: cpu: "1" memory: "200Mi" restartPolicy: Never EOFLabel the default namespace to be managed by Kueue by running the following command:
$ oc label namespace default kueue.openshift.io/managed=trueCreate the six jobs by running the following command:
for i in {1..6}; do oc create -f job.yaml; doneIn this example, three of the jobs saturate the
ClusterQueueresource and the other three jobs should be pending.
2.11.3.1. Viewing pending workloads in ClusterQueue Copy linkLink copied to clipboard!
To view all pending workloads at the cluster level, administrators can use the ClusterQueue object visibility endpoint of Kueue’s visibility API. This endpoint returns a list of all workloads currently waiting for admission by that ClusterQueue resource.
Procedure
To view pending workloads in
ClusterQueuerun the following command:$ oc get --raw "/apis/visibility.kueue.x-k8s.io/v1beta2/clusterqueues/cluster-queue/pendingworkloads"Example output
{ "kind": "PendingWorkloadsSummary", "apiVersion": "visibility.kueue.x-k8s.io/v1beta2", "metadata": { "creationTimestamp": null }, "items": [ { "metadata": { "name": "job-sample-job-jrjfr-8d56e", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-jrjfr", "uid": "5863cf0e-b0e7-43bf-a445-f41fa1abedfa" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 0, "positionInLocalQueue": 0 }, { "metadata": { "name": "job-sample-job-jg9dw-5f1a3", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-jg9dw", "uid": "fd5d1796-f61d-402f-a4c8-cbda646e2676" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 1, "positionInLocalQueue": 1 }, { "metadata": { "name": "job-sample-job-t9b8m-4e770", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-t9b8m", "uid": "64c26c73-6334-4d13-a1a8-38d99196baa5" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 2, "positionInLocalQueue": 2 } ] }You can pass the following optional query parameters:
limit <integer>- 1000 is the default. Specifies the maximum number of pending workloads that should be fetched.
offset <integer>- 0 is the default. Specifies the position of the first pending workload that should be fetched, starting from 0.
To view only one pending workload starting from position 0 in
ClusterQueuerun the following command:$ oc get --raw "/apis/visibility.kueue.x-k8s.io/v1beta2/clusterqueues/cluster-queue/pendingworkloads?limit=1&offset=0"
2.11.3.2. Viewing pending workloads in LocalQueue Copy linkLink copied to clipboard!
To view the pending workloads submitted by a specific tenant within their namespace, users can query the LocalQueue resource visibility endpoint of Kueue’s visibility API. This provides an ordered list of their jobs waiting in that queue.
Procedure
To view pending workloads in
LocalQueuerun the following command:$ oc get --raw /apis/visibility.kueue.x-k8s.io/v1beta2/namespaces/default/localqueues/user-queue/pendingworkloadsExample output
{ "kind": "PendingWorkloadsSummary", "apiVersion": "visibility.kueue.x-k8s.io/v1beta2", "metadata": { "creationTimestamp": null }, "items": [ { "metadata": { "name": "job-sample-job-jrjfr-8d56e", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-jrjfr", "uid": "5863cf0e-b0e7-43bf-a445-f41fa1abedfa" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 0, "positionInLocalQueue": 0 }, { "metadata": { "name": "job-sample-job-jg9dw-5f1a3", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-jg9dw", "uid": "fd5d1796-f61d-402f-a4c8-cbda646e2676" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 1, "positionInLocalQueue": 1 }, { "metadata": { "name": "job-sample-job-t9b8m-4e770", "namespace": "default", "creationTimestamp": "2023-12-05T15:42:03Z", "ownerReferences": [ { "apiVersion": "batch/v1", "kind": "Job", "name": "sample-job-t9b8m", "uid": "64c26c73-6334-4d13-a1a8-38d99196baa5" } ] }, "priority": 0, "localQueueName": "user-queue", "positionInClusterQueue": 2, "positionInLocalQueue": 2 } ] }You can pass the following optional query parameters:
limit <integer>- 1000 is the default. Specifies the maximum number of pending workloads that should be fetched.
offset <integer>- 0 is the default. Specifies the position of the first pending workload that should be fetched, starting from 0.
To view only one pending workload starting from position 0 in LocalQueue run the following command:
$ oc get --raw "/apis/visibility.kueue.x-k8s.io/v1beta2/namespaces/default/localqueues/user-queue/pendingworkloads?limit=1&offset=0"
2.11.4. Modifying monitoring settings Copy linkLink copied to clipboard!
Modify the monitoring settings according to your organization’s requirements to ensure users can access and view the pending workloads in a timely and reliable manner.
This procedure tells you how to modify the resource flow control for the Red Hat build of Kueue VisibilityOnDemand feature. Modifications directly impact the system’s ability to handle concurrent requests for job visibility information.
Procedure
Edit the
PriorityLevelConfigurationasset forVisibilityOnDemandonKueueby running the following command:$ oc edit prioritylevelconfiguration kueue-visibilityModify the
nominalConcurrencySharesfield in thePriorityLevelConfigurationasset by setting the value forkueue.openshift.io/allow-nominal-concurrency-shares-updatetotrue.The possible values you can specify for
nominalConcurrencySharesare0,2(the default) until5. If you specify a value that is not acceptable (the value1or any value above5), the default value2, is enforced.See the following example:
apiVersion: flowcontrol.apiserver.k8s.io/v1 kind: PriorityLevelConfiguration metadata: name: kueue-visibility annotations: kueue.openshift.io/allow-nominal-concurrency-shares-update: "false" spec: limited: borrowingLimitPercent: 0 lendablePercent: 90 limitResponse: queuing: handSize: 4 queueLengthLimit: 50 queues: 16 type: Queue nominalConcurrencyShares: 2 type: LimitedThe default value for
kueue.openshift.io/allow-nominal-concurrency-shares-updateisfalse. If you change the value ofnominalConcurrencySharesto any value other than2, then you must first change the value ofkueue.openshift.io/allow-nominal-concurrency-shares-updatetotrue. Otherwise, the value you assign fornominalConcurrencyShareswill not take effect.Verify the value is kept by running the following command:
$ oc get prioritylevelconfiguration kueue-visibility
2.12. Using cohorts Copy linkLink copied to clipboard!
You can use cohorts to group cluster queues and determine which cluster queues can share borrowable resources with each other.
Borrowable resources are defined as the unused nominal quota of all the cluster queues in a cohort.
By using cohorts, you can optimize resource utilization, prevent under-utilization, and enable fair sharing configurations. In addition, you can simplify resource management and allocation between teams, because you can group cluster queues for related workloads or for each team. You can also use cohorts to set resource quotas at a group level to define the limits for resources that a group of cluster queues can consume.
2.12.1. Cohort configuration within a cluster queue spec Copy linkLink copied to clipboard!
You can add a cluster queue to a cohort by specifying the cohort name in the .spec.cohortName field of the ClusterQueue object.
The following example shows a ClusterQueue object with a cohort configured:
apiVersion: kueue.x-k8s.io/v1beta2
kind: ClusterQueue
metadata:
name: cluster-queue
spec:
# ...
cohortName: example-cohort
# ...
All cluster queues that have a matching spec.cohortName are part of the same cohort.
If the spec.cohortName field is omitted, the cluster queue does not belong to any cohort and cannot access borrowable resources.
2.13. Configuring fair sharing Copy linkLink copied to clipboard!
You can configure fair sharing as a preemption strategy to distribute borrowable resources equally or by weight between tenants of a cohort.
Borrowable resources are the unused nominal quota of all the cluster queues in a cohort.
You can configure fair sharing by setting the preemptionPolicy value in the Kueue custom resource (CR) to FairSharing.
2.14. Admission fair sharing Copy linkLink copied to clipboard!
Use admission fair sharing to fairly distribute workloads across local Queues that share a single ClusterQueue.
You can balance workload admission by prioritizing workloads from local Queues that have used fewer resources historically. With admission fair sharing, you can track usage over time with a configurable decay function and apply admission penalties when workloads are admitted.
When multiple tenants share a single ClusterQueue, some tenants risk resource starvation. Admission fair sharing adresses this issue by meeting the following requirements:
- Enforce multi-tenant fairness (business critical)
- Ensure fair distribution of cluster resources across all tenants based on their usage history.
- Improve service predictability
- Guarantee each tenant gets a consistent share of resources, reducing latency spikes and preventing starvation.
- Enable scalable governance
- Complement static quotas with dynamic, usage-based admission ordering that adapts as tenant demand changes.
2.14.1. Configuring the Red Hat build of Kueue instance for admission fair sharing Copy linkLink copied to clipboard!
Configure Red Hat build of Kueue admission fair sharing using either the Default or Custom configuration.
Procedure
Choose the
configurationtype you want to use:-
Default: Uses predefined values. -
Custom: Uses values that you specify.
-
Apply your chosen configuration:
Use the following command to create a
Defaultconfiguration:$ oc patch kueue.kueue.openshift.io/cluster --type=merge -p \ '{"spec":{"config":{"admissionFairSharing":{"configuration":"Default","custom":null}}}}'Example of Kueue instance output
config: admissionFairSharing: configuration: DefaultUse the following command to create a
Customconfiguration that applies values that you specify:$ oc patch kueue.kueue.openshift.io/cluster --type=merge -p \ '{"spec":{"config":{"admissionFairSharing":{"configuration":"Custom","custom":{"usageHalfLifeTimeSeconds":10,"usageSamplingIntervalSeconds":10,"resourceWeights":[{"name":"cpu","weight":"2.0"}]}}}}}'Example of Kueue instance output
config: admissionFairSharing: configuration: Custom custom: resourceWeights: - name: cpu weight: "2.0" usageHalfLifeTimeSeconds: 10 usageSamplingIntervalSeconds: 10resourceWeights- Assigns weights to resources. The higher the weight, the higher the penalty.
usageHalfLifeTimeSeconds- The time in seconds after which the current usage will decrease by half. That is, it controls how long the past consumption should impact future admission.
usageSamplingIntervalSeconds-
The frequency in seconds that Red Hat build of Kueue updates the
consumedResourcescomponent in theFairSharingStatuscomponent.
2.14.1.1. Set resource weights Copy linkLink copied to clipboard!
Resources measured in bytes, like memory, require scaled-down resourceWeights values. Kubernetes represents memory in bytes, creating values that are billions of times larger than CPU core counts.
This numeric difference makes CPU weights ineffective unless you scale memory weights down. Without this adjustment, the raw byte value of these resources will numerically dominate human-scale resources, such as CPU cores, by several orders of magnitude, effectively making their weights meaningless.
For example, if you want to achieve an effective memory weight of 1.0, you would need to instead specify 9.31e-10, which corresponds to 1.0 / 1,073,741,824.
2.14.2. Configuring a cluster queue for admission fair sharing Copy linkLink copied to clipboard!
Configure the admissionScope section in your ClusterQueue object to be UsageBasedAdmissionFairSharing.
Procedure
Specify
UsageBasedAdmissionFairSharingas shown in the following example:apiVersion: kueue.x-k8s.io/v1beta2 kind: ClusterQueue metadata: name: shared-queue spec: namespaceSelector: {} admissionScope: admissionMode: UsageBasedAdmissionFairSharing resourceGroups: - coveredResources: ["cpu", "memory"] flavors: - name: afs-rf resources: - name: cpu nominalQuota: 2 - name: memory nominalQuota: 2Gi
2.14.3. Configuring a local queue for admission fair sharing (optional) Copy linkLink copied to clipboard!
Optionally, you can configure fairSharing section in your LocalQueue object to adjust its weight in the fair sharing calculation. The higher the weight, the lower the penalty. For example, specifying a weight of 2 treats the queue as if it is used by half as many resources.
Procedure
Specify a
weightvalue as shown in the following example:apiVersion: kueue.x-k8s.io/v1beta2 kind: LocalQueue metadata: name: team-a-queue namespace: team-a spec: clusterQueue: shared-queue fairSharing: weight: "2" # This queue will be treated as if it used half as many resources
2.14.4. Verifying the admission fair sharing status Copy linkLink copied to clipboard!
Check the admissionFairSharingStatus status in the local queue.
Procedure
Use the following command to verify the status of admission fair sharing:
$ oc get lq <local-queue-name> -n <local-queue-namespace> -o jsonpath={.status.fairSharing}Example output
{"admissionFairSharingStatus":{"consumedResources":{"cpu":"31999m"},"lastUpdate":"2025-06-03T14:25:15Z"},"weightedShare":0}
2.15. Gang scheduling Copy linkLink copied to clipboard!
You can use gang scheduling to ensure that a group, or gang, of related jobs starts only when all required resources are available.
Red Hat build of Kueue enables gang scheduling by suspending jobs until the OpenShift Container Platform cluster can guarantee the capacity to start and execute all of the related jobs in the gang together. This is also known as all-or-nothing scheduling.
Gang scheduling is important if you are working with expensive, limited resources, such as GPUs. Gang scheduling can prevent jobs from claiming but not using GPUs, which can improve GPU utilization and can reduce running costs. Gang scheduling can also help to prevent issues like resource segmentation and deadlocking.
2.15.1. Configuring gang scheduling Copy linkLink copied to clipboard!
As a cluster administrator, you can configure gang scheduling by modifying the gangScheduling spec in the Kueue custom resource (CR).
Example Kueue CR with gang scheduling configured
apiVersion: kueue.openshift.io/v1
kind: Kueue
metadata:
name: cluster
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kueue-operator
namespace: openshift-kueue-operator
spec:
config:
gangScheduling:
policy: ByWorkload
byWorkload:
admission: Parallel
# ...
spec.config.gangScheduling.policy-
You can set the
policyvalue to enable or disable gang scheduling. The possible values areByWorkload,None, or empty (""). When thepolicyvalue is set toByWorkload, each job is processed and considered for admission as a single unit. If the job does not become ready within the specified time, the entire job is evicted and retried at a later time. When thepolicyvalue is set toNone, gang scheduling is disabled. When thepolicyvalue is empty or set to"", the Red Hat build of Kueue Operator determines settings for gang scheduling. Currently, gang scheduling is disabled by default. spec.config.gangScheduling.byWorkload.admission-
If the
policyvalue is set toByWorkload, you must configure job admission settings. The possible values for theadmissionspec areParallel,Sequential, or empty (""). When theadmissionvalue is set toParallel, pods from any job can be admitted at any time. This can cause a deadlock, where jobs are in contention for cluster capacity. When a deadlock occurs, the successful scheduling of pods from another job can prevent the scheduling of pods from the current job. When theadmissionvalue is set toSequential, only pods from the currently processing job are admitted. After all of the pods from the current job have been admitted and are ready, Red Hat build of Kueue processes the next job. Sequential processing can slow down admission when the cluster has sufficient capacity for multiple jobs, but provides a higher likelihood that all of the pods for a job are scheduled together successfully. When theadmissionvalue is empty or set to"", the Red Hat build of Kueue Operator determines job admission settings. Currently, theadmissionvalue is set toParallelby default.
2.16. Running jobs with quota limits Copy linkLink copied to clipboard!
You can run Kubernetes jobs with Red Hat build of Kueue enabled to manage resource allocation within defined quota limits. Running jobs with quota limits provides predictable resource availability, cluster stability, and optimized performance.
2.16.1. Identifying available local queues Copy linkLink copied to clipboard!
Before you can submit a job to a queue, you must find the name of the local queue.
Prerequisites
- A cluster administrator has installed and configured Red Hat build of Kueue on your OpenShift Container Platform cluster.
-
A cluster administrator has assigned you the
kueue-batch-user-rolecluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
Run the following command to list available local queues in your namespace:
$ oc -n <namespace> get localqueuesExample output
NAME CLUSTERQUEUE PENDING WORKLOADS user-queue cluster-queue 3
2.16.2. Defining a job to run with Red Hat build of Kueue Copy linkLink copied to clipboard!
When you are defining a job to run with Red Hat build of Kueue, ensure that it meets the required criteria.
The job must:
-
Specify the local queue to submit the job to, by using the
kueue.x-k8s.io/queue-namelabel. - Include the resource requests for each job pod.
Red Hat build of Kueue suspends the job, and then starts it when resources are available. Red Hat build of Kueue creates a corresponding workload, represented as a Workload object with a name that matches the job.
Prerequisites
- A cluster administrator has installed and configured Red Hat build of Kueue on your OpenShift Container Platform cluster.
-
A cluster administrator has assigned you the
kueue-batch-user-rolecluster role. -
You have installed the OpenShift CLI (
oc). - You have identified the name of the local queue that you want to submit jobs to.
Procedure
Create a
Jobobject.Example job
apiVersion: batch/v1 kind: Job metadata: generateName: sample-job- namespace: my-namespace labels: kueue.x-k8s.io/queue-name: user-queue spec: parallelism: 3 completions: 3 template: spec: containers: - name: dummy-job image: registry.k8s.io/e2e-test-images/agnhost:2.53 args: ["entrypoint-tester", "hello", "world"] resources: requests: cpu: 1 memory: "200Mi" restartPolicy: Neverwhere:
kind-
Defines the resource type as a
Jobobject, which represents a batch computation task. metadata.generateName- Provides a prefix for generating a unique name for the job.
metadata.labels.kueue.x-k8s.io/queue-name- Identifies the queue to send the job to.
spec.template.spec.containers[].resources- Defines the resource requests for each pod.
Run the job by running the following command:
$ oc create -f <filename>.yaml
Verification
Verify that pods are running for the job you have created, by running the following command and observing the output:
$ oc get job <job-name>Example output
NAME STATUS COMPLETIONS DURATION AGE sample-job-sk42x Suspended 0/1 2m12sVerify that a workload has been created in your namespace for the job, by running the following command and observing the output:
$ oc -n <namespace> get workloadsExample output
NAME QUEUE RESERVED IN ADMITTED FINISHED AGE job-sample-job-sk42x-77c03 user-queue 3m8s
2.17. Getting support Copy linkLink copied to clipboard!
If you experience difficulty with a procedure described in this documentation, or with Red Hat build of Kueue in general, visit the Red Hat Customer Portal.
From the Customer Portal, you can:
- Search or browse through the Red Hat Knowledgebase of articles and solutions relating to Red Hat products.
- Submit a support case to Red Hat Support.
- Access other product documentation.
2.17.1. About the Red Hat Knowledgebase Copy linkLink copied to clipboard!
The Red Hat Knowledgebase provides rich content aimed at helping you make the most of Red Hat’s products and technologies. The Red Hat Knowledgebase consists of articles, product documentation, and videos outlining best practices on installing, configuring, and using Red Hat products. In addition, you can search for solutions to known issues, each providing concise root cause descriptions and remedial steps.
2.17.2. Collecting data for Red Hat Support Copy linkLink copied to clipboard!
You can use the oc adm must-gather CLI command to collect the information about your Red Hat build of Kueue instance that is most likely needed for debugging issues.
Information collected includes:
- Red Hat build of Kueue custom resources, such as workloads, cluster queues, local queues, resource flavors, admission checks, and their corresponding cluster resource definitions (CRDs)
- Services
- Endpoints
- Webhook configurations
-
Logs from the
openshift-kueue-operatornamespace andkueue-controller-managerpods
Collected data is written into a new directory named must-gather/ in the current working directory by default.
Prerequisites
- The Red Hat build of Kueue Operator is installed on your cluster.
-
You have installed the OpenShift CLI (
oc).
Procedure
-
Navigate to the directory where you want to store the
must-gatherdata. Collect
must-gatherdata by running the following command:$ oc adm must-gather \ --image=registry.redhat.io/kueue/kueue-must-gather-rhel9:<version>Where
<version>is your current version of Red Hat build of Kueue.-
Create a compressed file from the
must-gatherdirectory that was just created in your working directory. Make sure you provide the date and cluster ID for the uniquemust-gatherdata. For more information about how to find the cluster ID, see "How to find the cluster-id or name on OpenShift cluster". - Attach the compressed file to your support case on the Customer Support page of the Red Hat Customer Portal.