Technology1 min read

How Kueue schedules Spark jobs fairly on Red Hat OpenShift AI

By · Published by Everything Blog

In short

Standard Kubernetes scheduling handles individual pods independently, leading to resource fragmentation when large workloads compete directly for cluster capacity. Kueue resolves this issue by suspending submitted Spark applications and admitting them only after verifying that total CPU and memory demands align with queue quotas. After Kueue admits a workload, the Kubeflow Spark Operator generates the necessary driver and executor pods to run the job. Proper deployment requires administrators to designate Kueue as unmanaged within the DataScienceCluster configuration to avoid conflicts with deprecated components.

Key points

  • Managing resources at the application level prevents partially scheduled jobs from consum…: Managing resources at the application level prevents partially scheduled jobs from consuming cluster capacity.
  • Explicit ClusterQueue and LocalQueue configurations provide clear quota boundaries that i…: Explicit ClusterQueue and LocalQueue configurations provide clear quota boundaries that integrate cleanly into GitOps workflows.
  • Administrators must set Kueue to an unmanaged state in the DataScienceCluster configurati…: Administrators must set Kueue to an unmanaged state in the DataScienceCluster configuration to eliminate operator conflicts.

Sources checked by our analysis pipeline: 1

Table of contents:

- How Kueue and the Spark Operator divide the work

- What you will build

- Set up the integration

- Prove it works

- 3 things the reference docs will not tell you

- Set up operational rules for the queue

- Conclusion

A Spark cluster can run out of headroom long before it looks large on paper. A data engineer submits a massive run, an ML team launches feature engineering, and suddenly both developers are staring at stuck pipelines wondering why their driver pods won't schedule. The Kubernetes scheduler places individual pods, but it has no opinion about which application should receive a team's quota first. So every Spark submission turns into a race, and whoever gets pods scheduled first wins.

Kueue changes the question from "which pod fits on which node?" to "which application deserves resources right now?" It holds a SparkApplication at the gate, before the Kubeflow Spark operator ever creates a driver or executor pod. When the application's declared CPU and memory fit within an available quota, Kueue admits it and the…

Technology