Overview of managing workloads with Kueue
Alauda Build of Kueue is a Kubernetes-native system that manages quotas and how jobs consume them. Alauda Build of Kueue decides when a job should wait, when a job should be admitted to start (as in pods can be created) and when a job should be preempted (as in active pods should be deleted).
Alauda 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.
Alauda Build of Kueue supports all-or-nothing semantics. This means that 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.
TOC
Supported workload typesQueue enforcement for projectsRestrictionsKueue workflowCluster administratorBatch administratorData scientist / ML engineerKey conceptsResource hierarchySupported workload types
The following workload types can be managed by Alauda Build of Kueue:
Queue enforcement for projects
Alauda Build of Kueue uses a label-based mechanism to manage workloads. To enable Kueue management for a namespace:
- Create a
LocalQueuein the namespace that points to aClusterQueue. - Workloads that carry the
kueue.x-k8s.io/queue-namelabel are managed by Kueue. - If a default local queue (named
default) exists in the namespace, workloads without the label are automatically assigned to it.
When a workload is submitted to a Kueue-managed queue, it enters a Suspended or SchedulingGated state until Kueue admits it based on the available quota. Once admitted, the workload's pods are created and scheduled normally by Kubernetes.
Note: For workloads created from the Alauda AI dashboard (such as workbenches or model servers), the queue name label is automatically applied when the user selects a local queue during creation.
Restrictions
When using Alauda Build of Kueue to manage workloads, be aware of the following restrictions:
- Every requestable resource must be covered. Any resource that a workload might request (CPU, memory, GPU, ephemeral-storage, etc.) must be listed in the ClusterQueue's
coveredResourceswith anominalQuotavalue (even if 0). If a workload requests a resource that is not covered, it will not be admitted. - Workbenches (Notebooks) are not suspendable. Because notebook sessions cannot be gracefully suspended and resumed, they must be assigned to a local queue backed by a non-preemptive ClusterQueue. If a workbench is assigned to a preemptive queue, it may be terminated without the ability to recover. See Configuring preemption for how to configure non-preemptive queues.
- Use ResourceFlavors for node placement instead of node selectors. When using Kueue, do not rely on node selectors or tolerations directly in the workload pod template for node placement. Instead, configure
ResourceFlavorobjects with the appropriatenodeLabelsandtolerations. Kueue injects the node affinity from the matched ResourceFlavor when it admits the workload. - InferenceService workloads require ephemeral-storage. When using Kueue with InferenceService (KServe), ensure that
ephemeral-storageis included in the ClusterQueue'scoveredResources, as KServe typically requests this resource.
Kueue workflow
The typical workflow for using Alauda Build of Kueue involves different roles:
Cluster administrator
- Install the Alauda Build of Kueue cluster plugin. See Install.
- Configure
ResourceFlavorobjects to represent the different node types in the cluster. - Configure
ClusterQueueobjects to define resource quotas and fair sharing rules. - Configure
LocalQueueobjects in each namespace that requires Kueue-managed workloads. - Set up RBAC permissions for batch administrators and users. See Setup RBAC.
Batch administrator
- Manage
ClusterQueueandLocalQueueobjects for their respective teams. - Monitor pending workloads and resource utilization using the Visibility API. See Monitoring pending workloads.
- Adjust quotas, fair sharing weights, and preemption policies as needed.
Data scientist / ML engineer
- Submit workloads (training jobs, inference services, etc.) to a local queue by adding the
kueue.x-k8s.io/queue-namelabel to the workload manifest. See Running jobs with Kueue. - Monitor the status of their workloads in the queue.
- If a default local queue is configured in the namespace, workloads are automatically assigned to it without needing to specify the label.
Key concepts
Alauda Build of Kueue introduces several key resources that work together to manage workload scheduling and resource allocation:
- ResourceFlavor: A cluster-scoped resource that represents different resource variations in the cluster. Resource flavors use node labels, taints, and tolerations to associate workloads with specific node types.
- ClusterQueue: A cluster-scoped resource that governs a pool of resources such as CPU, memory, pods, and GPUs. Cluster queues define usage limits, quotas for resource flavors, and fair sharing rules.
- LocalQueue: A namespace-scoped resource that groups related workloads belonging to a single namespace. A local queue points to a cluster queue, allocating the cluster queue's resources to workloads in that namespace.
- Workload: The unit of admission in Alauda Build of Kueue. A workload is an application that runs to completion and can be composed of one or multiple pods.
- Cohort: A group of cluster queues that can share borrowable resources with each other, enabling better resource utilization across teams.