Chapter 8. Manage workloads with Kueue
As a cluster administrator, you can manage AI and machine learning workloads at scale by integrating the Red Hat build of Kueue with Red Hat OpenShift AI. This integration provides capabilities for quota management, resource allocation, and prioritized job scheduling.
Starting with OpenShift AI 2.24, the embedded Kueue component for managing distributed workloads is deprecated. Kueue is now provided through Red Hat build of Kueue, which is installed and managed by the Red Hat build of Kueue Operator. You cannot install both the embedded Kueue and the Red Hat build of Kueue Operator on the same cluster because this creates conflicting controllers that manage the same resources.
OpenShift AI does not automatically migrate existing workloads. To ensure your workloads continue using queue management after upgrading, cluster administrators must manually migrate from the embedded Kueue to the Red Hat build of Kueue Operator. For more information, see Migrate to the Red Hat build of Kueue Operator.
8.1. Kueue workload management Copy linkLink copied to clipboard!
You can use Kueue in OpenShift AI to manage AI and machine learning workloads at scale. Kueue controls how cluster resources are allocated and shared through hierarchical quota management, dynamic resource allocation, and prioritized job scheduling. These capabilities help prevent cluster contention, ensure fair access across teams, and optimize the use of heterogeneous compute resources, such as hardware accelerators.
You can use Kueue to schedule diverse workloads, including distributed training jobs (RayJob, RayCluster, PyTorchJob), workbenches (Notebook), and model serving (InferenceService). Kueue validation and queue enforcement apply only to workloads in namespaces with the kueue.openshift.io/managed=true label.
Using Kueue in OpenShift AI provides these benefits:
- Prevents resource conflicts and prioritizes workload processing
- Manages quotas across teams and projects
- Ensures consistent scheduling for all workload types
- Maximizes GPU and other specialized hardware use
Starting with OpenShift AI 2.24, the embedded Kueue component for managing distributed workloads is deprecated. Kueue is now provided through Red Hat build of Kueue, which is installed and managed by the Red Hat build of Kueue Operator. You cannot install both the embedded Kueue and the Red Hat build of Kueue Operator on the same cluster because this creates conflicting controllers that manage the same resources.
OpenShift AI does not automatically migrate existing workloads. To ensure your workloads continue using queue management after upgrading, cluster administrators must manually migrate from the embedded Kueue to the Red Hat build of Kueue Operator. For more information, see Migrate to the Red Hat build of Kueue Operator in the Additional resources section.
Kueue management states:
You configure how OpenShift AI interacts with Kueue by setting the managementState in the DataScienceCluster object.
UnmanagedThis state is supported for using Kueue with OpenShift AI. In
Unmanagedstate, OpenShift AI integrates with an existing Kueue installation managed by the Red Hat build of Kueue Operator. You must have the Red Hat build of Kueue Operator installed and running on the cluster.When you enable
Unmanagedmode, the OpenShift AI Operator creates a defaultKueuecustom resource (CR) if one does not already exist. This prompts the Red Hat build of Kueue Operator to activate Kueue on the cluster.Managed-
This state is deprecated. Previously, OpenShift AI deployed and managed an embedded Kueue distribution.
Managedmode is not compatible with the Red Hat build of Kueue Operator. If both are installed, OpenShift AI stops reconciliation to avoid conflicts. You must migrate any environment by using theManagedstate to theUnmanagedstate to ensure continued support. Removed-
This state disables Kueue in OpenShift AI. If the state was previously
Managed, OpenShift AI uninstalls the embedded Kueue distribution. If the state was previouslyUnmanaged, OpenShift AI stops checking for the external Kueue integration but does not uninstall the Red Hat build of Kueue Operator. An emptymanagementStatevalue also functions asRemoved.
Queue creation modes:
You control whether the OpenShift AI Operator automatically creates default ClusterQueue and LocalQueue resources by setting the autoCreateQueues field in the DataScienceCluster resource.
- Operator-managed queues:
autoCreateQueues: true -
The Operator creates a default
ClusterQueueand aLocalQueuein each Kueue-managed namespace. The Operator applies theplatform.opendatahub.io/part-of=kueuelabel to these resources. You can customize the queue names by using thedefaultClusterQueueNameanddefaultLocalQueueNamefields. This mode is suitable for quick-start deployments and evaluation environments. - Self-managed queues:
autoCreateQueues: falseor omitted The Operator does not create queue resources. You manage all
ClusterQueueandLocalQueueresources outside the Operator by using GitOps tools,kubectl, or the Red Hat build of Kueue Operator directly. This mode is the default and is suitable for enterprise multitenant GPU environments that require strict quota control.For more information, see Manage ClusterQueues and LocalQueues outside the Operator in Additional resources.
When autoCreateQueues transitions from true to false, the Operator stops creating new queue resources but does not remove previously created ClusterQueue or LocalQueue instances.
Queue enforcement for projects:
To ensure workloads do not bypass the queuing system, a validating webhook automatically enforces queuing rules on any project that is enabled for Kueue management. You enable a project for Kueue management by applying the kueue.openshift.io/managed=true label to the project namespace.
This validating webhook enforcement method replaces the Validating Admission Policy that was used with the deprecated embedded Kueue component. The system also supports the legacy kueue-managed label for backward compatibility, but kueue.openshift.io/managed=true is the recommended label going forward.
After a project is enabled for Kueue management, the webhook requires that any new or updated workload has the kueue.x-k8s.io/queue-name label. If this label is missing, the webhook prevents the workload from being created or updated.
When autoCreateQueues is set to true, OpenShift AI creates a default, cluster-scoped ClusterQueue and a namespace-scoped LocalQueue for that namespace if one does not already exist. These default resources are created with the opendatahub.io/managed=false annotation, so they are not managed after creation. Cluster administrators can change or delete them.
When autoCreateQueues is set to false or is omitted, the Operator does not create queue resources. You must create ClusterQueue and LocalQueue resources before submitting workloads.
Enabling Kueue in the OpenShift AI dashboard creates a LocalQueue in new project namespaces independently of the autoCreateQueues setting. This dashboard-triggered queue creation is a separate mechanism from the DataScienceCluster-level queue creation controlled by autoCreateQueues.
The webhook enforces this rule on the create and update operations for the following resource types:
-
InferenceService -
Notebook -
PyTorchJob -
RayCluster -
RayJob
You can apply hardware profiles to other workload types, but the validation webhook enforces the kueue.x-k8s.io/queue-name label requirement only for these specific resource types.
Restrictions for managing workloads with Kueue:
When you use Kueue to manage workloads in OpenShift AI, the following restrictions apply:
-
Namespaces must be labeled with
kueue.openshift.io/managed=trueto enable Kueue validation and queue enforcement. - All workloads that you create from the OpenShift AI dashboard, such as workbenches and model servers, must use a hardware profile that specifies a local queue.
-
When you specify a local queue in a hardware profile, OpenShift AI automatically applies the corresponding
kueue.x-k8s.io/queue-namelabel to workloads that use that profile. - You cannot use hardware profiles that contain node selectors or tolerations for node placement. To direct workloads to specific nodes, use a hardware profile that specifies a local queue that is associated with a queue configured with the appropriate resource flavors.
- Because workbenches are not suspendable workloads, you can only assign them to a local queue that is associated with a non-preemptive cluster queue.
-
When
autoCreateQueuesis set totrue, the default cluster queue that OpenShift AI creates is non-preemptive. If you manage queues outside the Operator, ensure that your cluster queue is configured as non-preemptive for workbench workloads.
Workbench scheduling visibility:
When a project namespace has the kueue.openshift.io/managed=true label and Kueue is enabled, the OpenShift AI dashboard provides scheduling visibility for workbenches in that project.
The following indicators are available:
- Project-level Kueue indicator
- An informational banner is displayed on the project details page confirming that the project uses queue-based scheduling. This banner is mutually exclusive with the Kueue-disabled alert.
- Workbench scheduling states
- The Status column on the Workbenches tab displays Kueue-derived states such as Queued, Inadmissible, Preempted, and Evicted for workbenches in the project. When a workbench is admitted by Kueue, the status column shows Starting rather than a Kueue-specific label. Data scientists can monitor these states to track the progress of their workbenches through the scheduling system.
- Anomaly warning for workbenches bypassing Kueue
-
When a workbench in a Kueue-managed namespace lacks the
kueue.x-k8s.io/queue-namelabel, it bypasses Kueue scheduling entirely. The dashboard shows a warning indicator on those workbench rows with a tooltip explaining the bypass. This situation typically occurs when a workbench is created through GitOps or the command-line interface without a queue assignment.
Additional resources
8.1.1. Kueue workflow Copy linkLink copied to clipboard!
Managing workloads with Kueue in OpenShift AI involves tasks for OpenShift cluster administrators, OpenShift AI administrators, and machine learning (ML) engineers or data scientists:
Cluster administrator
Installs and configures Kueue:
- Installs the Red Hat build of Kueue Operator on the cluster, as described in the Red Hat build of Kueue documentation in Additional resources.
-
Activates the Kueue integration by setting the
managementStatetoUnmanagedin theDataScienceClustercustom resource, as described in Configure workload management with Kueue in Additional resources. Chooses a queue management mode:
-
Operator-managed queues: Sets
autoCreateQueuestotrueto have the Operator create defaultClusterQueueandLocalQueueresources. -
Self-managed queues: Keeps
autoCreateQueuesset tofalseor omits it, then createsClusterQueueandLocalQueueresources outside the Operator by using GitOps,kubectl, or the Red Hat build of Kueue Operator directly. For more information, see Manage ClusterQueues and LocalQueues outside the Operator in Additional resources.
-
Operator-managed queues: Sets
- Configures quotas to optimize resource allocation for user workloads, as described in the Red Hat build of Kueue documentation in Additional resources.
Enables Kueue in the dashboard by setting
disableKueuetofalsein theOdhDashboardConfigcustom resource, as described in Enable Kueue in the dashboard in Additional resources.NoteWhen Kueue is enabled in the dashboard, OpenShift AI automatically enables Kueue management for all new projects created from the dashboard.
OpenShift AI administrator
Prepares the OpenShift AI environment:
- Creates Kueue-enabled hardware profiles so that users can submit workloads from the OpenShift AI dashboard, as described in Working with hardware profiles in Additional resources.
ML Engineer or data scientist
Submits workloads to the queuing system and monitors scheduling status:
- For workloads created from the OpenShift AI dashboard, such as workbenches and model servers, selects a Kueue-enabled hardware profile during creation.
-
For workloads created by using a command-line interface or a software development kit (SDK), such as distributed training jobs, adds the
kueue.x-k8s.io/queue-namelabel to the workload’s YAML manifest and sets its value to the targetLocalQueuename. - After starting or creating a workbench, views the scheduling status on the Workbenches tab. For Kueue-managed workbenches, the status shows the current Kueue state, such as Queued or Starting, and the queue position when available.
When Kueue is enabled in the dashboard, workbenches that were created through GitOps or the command-line interface without the kueue.x-k8s.io/queue-name label bypass Kueue scheduling and show an anomaly warning on the Workbenches tab.
8.2. Configure workload management with Kueue Copy linkLink copied to clipboard!
To use workload queuing in OpenShift AI, install the Red Hat build of Kueue Operator, activate the Kueue integration, and choose how to manage queue resources. You can have the Operator create default queue resources automatically, or you can manage queues outside the Operator for strict quota control.
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
- You are using OpenShift 4.19 or later.
- You have installed and configured the cert-manager Operator for Red Hat OpenShift for your cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
In a terminal window, log in to the OpenShift CLI (
oc) as shown in the following example:$ oc login <openshift_cluster_url> -u <admin_username> -p <password>- Install the Red Hat build of Kueue Operator on your OpenShift cluster as described in the Red Hat build of Kueue documentation.
Activate the Kueue integration. Choose one of the following options based on how you want to manage queue resources.
NoteIn OpenShift AI 3.5, the
autoCreateQueuesfield defaults tofalse. The Operator does not create defaultClusterQueueorLocalQueueresources unless you explicitly setautoCreateQueuestotrue.Operator-managed queues with predefined names: To have the Operator create default queue resources with the predefined name
default, run the following command. Replace<operator_namespace>with your Operator namespace. The default Operator namespace isredhat-ods-operator.$ oc patch datasciencecluster default-dsc --type='merge' -p '{"spec":{"components":{"kueue":{"managementState":"Unmanaged","autoCreateQueues":true}}}}' -n <operator_namespace>Operator-managed queues with custom names: To have the Operator create default queue resources with custom names, run the following command. Replace
<example_cluster_queue>and<example_local_queue>with your custom queue names, and replace<operator_namespace>with your Operator namespace. The default Operator namespace isredhat-ods-operator.$ oc patch datasciencecluster default-dsc --type='merge' -p '{"spec":{"components":{"kueue":{"managementState":"Unmanaged","autoCreateQueues":true,"defaultClusterQueueName":"<example_cluster_queue>","defaultLocalQueueName":"<example_local_queue>"}}}}' -n <operator_namespace>Self-managed queues: To manage queue resources outside the Operator by using GitOps,
kubectl, or the Red Hat build of Kueue Operator directly, run the following command. Replace<operator_namespace>with your Operator namespace. The default Operator namespace isredhat-ods-operator.$ oc patch datasciencecluster default-dsc --type='merge' -p '{"spec":{"components":{"kueue":{"managementState":"Unmanaged"}}}}' -n <operator_namespace>Because
autoCreateQueuesdefaults tofalse, this command activates the Kueue integration without creating Operator-managed queue resources. You must createClusterQueueandLocalQueueresources before submitting workloads. For more information, see Manage ClusterQueues and LocalQueues outside the Operator.
Verification
Verify that the
Kueuecustom resource was created:$ oc get kueue -AYou see a
KueueCR listed. If no resource is returned, the OpenShift AI Operator has not activated Kueue, and subsequent steps fail.Verify that the Red Hat build of Kueue pods are running:
$ oc get pods -n openshift-kueue-operatorIf the Red Hat build of Kueue Operator was installed in a custom namespace, replace
openshift-kueue-operatorwith your namespace.You see output similar to the following example:
kueue-controller-manager-d9fc745df-ph77w 1/1 Running openshift-kueue-operator-69cfbf45cf-lwtpm 1/1 RunningIf you chose Operator-managed queues, verify that the default
ClusterQueuewas created:$ oc get clusterqueuesIf you chose self-managed queues, verify that no Operator-managed
ClusterQueueexists:$ oc get clusterqueues -l platform.opendatahub.io/part-of=kueueThe output should show no resources.
Next steps
8.2.1. Enable Kueue in the dashboard Copy linkLink copied to clipboard!
Enable Kueue in the OpenShift AI dashboard so that users can select Kueue-enabled options when creating workloads.
When you enable Kueue in the dashboard, OpenShift AI automatically enables Kueue management for all new projects created from the dashboard. For these projects, OpenShift AI applies the kueue.openshift.io/managed=true label to the namespace and creates a LocalQueue object if one does not already exist. The LocalQueue object is created with the opendatahub.io/managed=false annotation, so it is not managed after creation. Cluster administrators can modify or delete it as needed. A validating webhook then enforces that any new or updated workload resource in a Kueue-enabled project includes the kueue.x-k8s.io/queue-name label.
This dashboard-triggered LocalQueue creation in new project namespaces is independent of the autoCreateQueues setting in the DataScienceCluster resource. The autoCreateQueues field controls whether the Operator creates default ClusterQueue and LocalQueue resources at the DataScienceCluster level. The dashboard creates a LocalQueue in new projects regardless of whether autoCreateQueues is true or false.
For existing projects, or for projects created by using the OpenShift CLI (oc), you must enable Kueue management manually by applying the kueue.openshift.io/managed=true label to the project namespace.
$ oc label namespace <project_namespace> kueue.openshift.io/managed=true --overwrite
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
- You are using OpenShift 4.19 or later.
- You have installed and activated the Red Hat build of Kueue Operator, as described in Configure workload management with Kueue.
- You have configured quotas, as described in the Red Hat build of Kueue documentation.
Procedure
In a terminal window, log in to the OpenShift CLI (
oc) as shown in the following example:$ oc login <openshift_cluster_url> -u <admin_username> -p <password>Update the
odh-dashboard-configcustom resource in the OpenShift AI applications namespace. Replace<applications_namespace>with your OpenShift AI applications namespace. The default isredhat-ods-applications.$ oc patch odhdashboardconfig odh-dashboard-config \ -n <applications_namespace> \ --type merge \ -p {"spec":{"dashboardConfig":{"disableKueue":false}}}
Verification
- From the OpenShift AI dashboard, create a new project.
Verify that the project namespace is labeled for Kueue management:
$ oc get ns <project_namespace> -o jsonpath='{.metadata.labels.kueue\.openshift\.io/managed}{"\n"}'The output should be
true.Confirm that a
LocalQueueexists for the project namespace:$ oc get localqueues -n <project_namespace>The
LocalQueuemight be created by the dashboard for new projects, by the Operator whenautoCreateQueuesistrue, or by the cluster administrator when managing queues outside the Operator.-
Create a test workload, for example a
Notebook, and verify that it includes thekueue.x-k8s.io/queue-namelabel.
Next steps
8.2.2. Manage ClusterQueues and LocalQueues outside the Operator Copy linkLink copied to clipboard!
You can manage ClusterQueue and LocalQueue resources outside the OpenShift AI Operator to enforce strict quota control in multitenant GPU environments. When autoCreateQueues is set to false in the DataScienceCluster resource, the Operator does not create queue resources, and you manage all queue resources by using GitOps tools, kubectl, or the Red Hat build of Kueue Operator directly.
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
- You are using OpenShift 4.19 or later.
- You have installed and configured the cert-manager Operator for Red Hat OpenShift for your cluster.
- You have installed the Red Hat build of Kueue Operator on your cluster, as described in the Red Hat build of Kueue documentation.
-
You have activated the Kueue integration by setting
kueue.managementStatetoUnmanagedin theDataScienceClusterresource, as described in Configure workload management with Kueue. -
The
autoCreateQueuesfield is set tofalseor is omitted in theDataScienceClusterresource. This is the default behavior. You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
-
The
jqcommand-line JSON processor is installed on your workstation. This tool is used in the verification steps.
Procedure
In a terminal window, log in to the OpenShift CLI (
oc) as shown in the following example:$ oc login <openshift_cluster_url> -u <admin_username> -p <password>Verify that
autoCreateQueuesis set tofalseor is not present in theDataScienceClusterresource:$ oc get datasciencecluster default-dsc -o jsonpath='{.spec.components.kueue}' | jq .The
autoCreateQueuesfield is either absent or set tofalse. If the field is set totrue, the Operator manages queue resources automatically and you do not need to create them manually.Create a
ClusterQueueresource with quota definitions. The following example creates a cluster queue with CPU, memory, and GPU quotas:apiVersion: kueue.x-k8s.io/v1beta1 kind: ClusterQueue metadata: name: <cluster_queue_name> spec: namespaceSelector: {} resourceGroups: - coveredResources: ["cpu", "memory", "nvidia.com/gpu"] flavors: - name: "<resource_flavor_name>" resources: - name: "cpu" nominalQuota: 9 - name: "memory" nominalQuota: 36Gi - name: "nvidia.com/gpu" nominalQuota: 5where:
<cluster_queue_name>-
Specifies the name of the cluster queue, for example
team-gpu-cluster-queue. namespaceSelector: {}- Specifies that all namespaces can submit workloads to this cluster queue. In multitenant environments, replace this with a label selector to restrict access to specific namespaces.
<resource_flavor_name>-
Specifies the name of a
ResourceFlavoryou have already created. ForResourceFlavorconfiguration, see Configuring a resource flavor. nominalQuotaSpecifies the maximum amount of each resource that the cluster queue can allocate.
Replace the example quota values with values appropriate for your cluster. If you use AMD GPUs, replace
nvidia.com/gpuwithamd.com/gpuin the example code.Apply the configuration:
$ oc apply -f cluster_queue.yaml
Create a
LocalQueueresource in each project namespace that points to the cluster queue. The following example creates a local queue in a project namespace:apiVersion: kueue.x-k8s.io/v1beta1 kind: LocalQueue metadata: name: <local_queue_name> namespace: <project_namespace> spec: clusterQueue: <cluster_queue_name>where:
<local_queue_name>-
Specifies the name of the local queue, for example
team-gpu-local-queue. <project_namespace>- Specifies the namespace of the project that uses this queue.
<cluster_queue_name>Specifies the name of the cluster queue you created in the previous step.
Apply the configuration:
$ oc apply -f local_queue.yamlRepeat this step for each project namespace that requires workload scheduling.
Enable Kueue management for each project namespace by applying the
kueue.openshift.io/managed=truelabel:$ oc label namespace <project_namespace> kueue.openshift.io/managed=true --overwrite
Verification
Verify that the
ClusterQueueresource was created and is active:$ oc get clusterqueuesVerify that the
LocalQueueresource exists in the target namespace:$ oc get localqueues -n <project_namespace>Verify that the local queue is ready to admit workloads:
$ oc get localqueues -n <project_namespace> -o jsonpath='{.items[0].status.conditions}' | jq .
When autoCreateQueues is false, the Operator does not create, modify, or reconcile any queue resources. Previously created queue resources remain on the cluster. Resources you create outside the Operator are not affected.
8.3. Troubleshooting reference: Kueue Copy linkLink copied to clipboard!
If your users are experiencing errors in Red Hat OpenShift AI relating to Kueue workloads, read this section to understand what could be causing the problem, and how to resolve the problem.
If the problem is not documented here or in the release notes, contact Red Hat Support.
8.3.1. A user receives a "failed to call webhook" error message for Kueue Copy linkLink copied to clipboard!
Problem
After the user runs the cluster.apply() command, the following error is shown:
ApiException: (500)
Reason: Internal Server Error
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Internal error occurred: failed calling webhook \"mraycluster.kb.io\": failed to call webhook: Post \"https://kueue-webhook-service.redhat-ods-applications.svc:443/mutate-ray-io-v1-raycluster?timeout=10s\": no endpoints available for service \"kueue-webhook-service\"","reason":"InternalError","details":{"causes":[{"message":"failed calling webhook \"mraycluster.kb.io\": failed to call webhook: Post \"https://kueue-webhook-service.redhat-ods-applications.svc:443/mutate-ray-io-v1-raycluster?timeout=10s\": no endpoints available for service \"kueue-webhook-service\""}]},"code":500}
Diagnosis
The Kueue pod might not be running.
Resolution
- In the OpenShift console, select the user’s project from the Project list.
-
Click Workloads
Pods. - Verify that the Kueue pod is running. If necessary, restart the Kueue pod.
Review the logs for the Kueue pod to verify that the webhook server is serving, as shown in the following example:
{"level":"info","ts":"2024-06-24T14:36:24.255137871Z","logger":"controller-runtime.webhook","caller":"webhook/server.go:242","msg":"Serving webhook server","host":"","port":9443}
8.3.2. A user receives a "Default Local Queue … not found" error message Copy linkLink copied to clipboard!
Problem
After the user runs the cluster.apply() command, the following error is shown:
Default Local Queue with kueue.x-k8s.io/default-queue: true annotation not found please create a default Local Queue or provide the local_queue name in Cluster Configuration.
Diagnosis
No default local queue is defined, and a local queue is not specified in the cluster configuration.
Resolution
Check whether a local queue exists in the user’s project, as follows:
- In the OpenShift console, select the user’s project from the Project list.
-
Click Home
Search, and from the Resources list, select LocalQueue. - If no local queues are found, create a local queue.
- Provide the user with the details of the local queues in their project, and advise them to add a local queue to their cluster configuration.
Define a default local queue.
For information about creating a local queue and defining a default local queue, see Configuring quota management for distributed workloads.
8.3.3. A user receives a "local_queue provided does not exist" error message Copy linkLink copied to clipboard!
Problem
After the user runs the cluster.apply() command, the following error is shown:
local_queue provided does not exist or is not in this namespace. Please provide the correct local_queue name in Cluster Configuration.
Diagnosis
An incorrect value is specified for the local queue in the cluster configuration, or an incorrect default local queue is defined. The specified local queue either does not exist, or exists in a different namespace.
Resolution
In the OpenShift console, select the user’s project from the Project list.
- Click Search, and from the Resources list, select LocalQueue.
Resolve the problem in one of the following ways:
- If no local queues are found, create a local queue.
-
If one or more local queues are found, provide the user with the details of the local queues in their project. Advise the user to ensure that they spelled the local queue name correctly in their cluster configuration, and that the
namespacevalue in the cluster configuration matches their project name.
Define a default local queue.
For information about creating a local queue and defining a default local queue, see Configuring quota management for distributed workloads.
8.3.4. The pod provisioned by Kueue is terminated before the image is pulled Copy linkLink copied to clipboard!
Problem
Kueue waits for a period of time before marking a workload as ready for all of the workload pods to become provisioned and running. By default, Kueue waits for 5 minutes. If the pod image is very large and is still being pulled after the 5-minute waiting period elapses, Kueue fails the workload and terminates the related pods.
Diagnosis
- In the OpenShift console, select the user’s project from the Project list.
-
Click Workloads
Pods. - Click the user’s pod name to open the pod details page.
- Click the Events tab, and review the pod events to check whether the image pull completed successfully.
Resolution
If the pod takes more than 5 minutes to pull the image, resolve the problem in one of the following ways:
-
Add an
OnFailurerestart policy for resources that are managed by Kueue. -
Configure a custom timeout for the
waitForPodsReadyproperty in theKueuecustom resource (CR). The CR is installed in theopenshift-kueue-operatornamespace by the Red Hat build of Kueue Operator.
For more information about this configuration option, see Enabling waitForPodsReady in the Kueue documentation.
8.4. Migrate to the Red Hat build of Kueue Operator Copy linkLink copied to clipboard!
Starting with OpenShift AI 2.24, the embedded Kueue component for managing distributed workloads is deprecated.
OpenShift AI now uses the Red Hat build of Kueue Operator to provide enhanced workload scheduling for distributed training, workbench, and model serving workloads.
Check if your environment is using the embedded Kueue component by verifying the spec.components.kueue.managementState field in the DataScienceCluster custom resource. If the field is set to Managed, you must migrate to the Red Hat build of Kueue Operator before upgrading OpenShift AI to avoid controller conflicts and ensure continued support for queue-based workloads.
OpenShift AI does not automatically migrate workloads, and you cannot install both the embedded Kueue and the Red Hat build of Kueue Operator on the same cluster.
Prerequisites
Your environment is currently using the embedded Kueue component. That is, the
spec.components.kueue.managementStatefield in theDataScienceClustercustom resource is set toManaged.NoteIf
spec.components.kueue.managementStateis set toRemovedorUnmanaged, skip this migration.- You have cluster administrator privileges for your OpenShift cluster.
- You are using OpenShift 4.19 or later.
- You have installed and configured the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
Optional: When you migrate from the embedded Kueue to Red Hat build of Kueue, the OpenShift AI Operator automatically moves your existing Kueue configuration from the
kueue-manager-configConfigMap to theKueuecustom resource (CR).If you want to keep the
kueue-manager-configConfigMap for reference, run the following command. Replace<applications_namespace>with your OpenShift AI applications namespace. The default namespace isredhat-ods-applications.$ oc annotate configmap kueue-manager-config -n <applications_namespace> opendatahub.io/managed=false- Log in to the OpenShift web console as a cluster administrator.
Uninstall the embedded Kueue component to avoid potential configuration conflicts.
NoteIf you need to keep workloads running without interruption, you can skip this step. However, skipping it is not recommended because it might cause temporary configuration issues during the OpenShift AI upgrade.
Go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
- Click the Red Hat OpenShift AI Operator.
- Click the Data Science Cluster tab.
- Click the default-dsc object.
- Click the YAML tab.
Set
spec.components.kueue.managementStatetoRemovedas shown:spec: components: kueue: managementState: Removed- Click Save.
Wait for the OpenShift AI Operator to reconcile, and then verify that the embedded Kueue was removed:
-
On the Details tab of the
default-dscobject, check that the KueueReady condition has a Status ofFalseand a Reason ofRemoved. -
Go to Workloads
Deployments, select the project where OpenShift AI is installed (for example, redhat-ods-applications), and confirm that Kueue-related deployments (for example,kueue-controller-manager) are no longer present.
-
On the Details tab of the
Install the Red Hat build of Kueue Operator on your OpenShift cluster:
- Follow the steps to install the Red Hat build of Kueue Operator, as described in the Red Hat build of Kueue documentation.
-
Go to Ecosystem
Installed Operators and confirm that the Red Hat build of Kueue Operator is listed with Status as Succeeded.
Activate the Red Hat build of Kueue Operator in OpenShift AI:
In the web console, go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
- Click the Red Hat OpenShift AI Operator.
- Click the Data Science Cluster tab.
- Click the default-dsc object.
- Click the YAML tab.
Set
spec.components.kueue.managementStatetoUnmanagedand choose a queue management mode. The following examples show the available options.NoteIn OpenShift AI 3.5,
autoCreateQueuesdefaults tofalse. If you want the Operator to create default queue resources after migrating from embedded Kueue, you must explicitly setautoCreateQueuestotrue.To use Operator-managed queues with the predefined queue names, apply the following configuration:
spec: components: kueue: managementState: Unmanaged autoCreateQueues: trueTo use Operator-managed queues with custom queue names, apply the following configuration, replacing
<example_cluster_queue>and<example_local_queue>with your custom values:spec: components: kueue: managementState: Unmanaged autoCreateQueues: true defaultClusterQueueName: <example_cluster_queue> defaultLocalQueueName: <example_local_queue>-
To manage queue resources outside the Operator, set only
managementStatetoUnmanagedand omitautoCreateQueues. For more information, see Manage ClusterQueues and LocalQueues outside the Operator.
- Click Save.
Enable Kueue management for existing projects by applying the
kueue.openshift.io/managed=truelabel to each project namespace:$ oc label namespace <project_namespace> kueue.openshift.io/managed=true --overwriteReplace
<project_namespace>with the name of your project.NoteKueue validation and queue enforcement apply only to workloads in namespaces labeled with
kueue.openshift.io/managed=true.
Verification
Verify that the embedded Kueue component was removed by confirming that Kueue-related deployments are no longer present in the OpenShift AI applications namespace:
$ oc get deployments -n <applications_namespace> | grep kueueThe output should be empty, indicating that no Kueue-related deployments exist.
Verify that the
DataScienceClusterresource shows a healthyUnmanagedstatus for Kueue:$ oc get datasciencecluster default-dsc -o jsonpath='{.status.conditions[?(@.type=="KueueReady")]}{"\n"}'Confirm that the
reasonfield showsUnmanaged.Verify that the Red Hat build of Kueue Operator pods are running:
$ oc get pods -n openshift-kueue-operatorIf the Red Hat build of Kueue Operator was installed in a custom namespace, replace
openshift-kueue-operatorwith your namespace.Verify that queue resources are available:
$ oc get clusterqueues $ oc get localqueues --all-namespaces- Verify that existing workloads in the queue continue to be processed by the Red Hat build of Kueue controllers by submitting a test workload and confirming that it is admitted.