This topic mainly describes how to use Kueue in a VKE cluster to implement the All-or-Nothing scheduling capability.
As a Kubernetes-native system, Kueue is used to manage quotas and control how jobs use quotas. In clusters that are shared among multiple teams or services, where complete batch job governance, such as governance on quotas, queues, priorities, and preemption, is required, All-or-Nothing can be achieved through the quota mechanism of Kueue (ClusterQueue) and gang admission (Workload). When the quota is insufficient to accommodate the entire job, the job remains suspended and does not schedule any pods.
- Configure the KubeConfig path in the local terminal.
- Use the Helm tool to install Kueue.
- Confirm the Kueue installation status.
- Confirm the Helm release status.
- The expected output is as follows: STATUS is deployed.
- Confirm the running status of the controller Pods.
- The expected output is as follows: READY is 1/1, and STATUS is Running.
- Check the registered CRDs.
- The expected output is as follows: CRDs such as clusterqueues, localqueues, workloads, and resourceflavors are visible.
Step 2: Perform job admission and scheduling
After Kueue is installed, use Kueue in the VKE cluster to verify the All-or-Nothing scheduling capability.
- Create a queue and set the quota.
- This topic configures a ClusterQueue quota of only 4 CPU cores. This is used to verify later that an entire Job is not admitted when the quota is insufficient. Run the following commands to create ResourceFlavor, ClusterQueue, and LocalQueue.
- Submit two jobs to verify gang admission.
- Each job requires 3 CPU cores (parallelism=3). However, the queue quota is only 4 cores, which can only accommodate one job. Add the label kueue.x-k8s.io/queue-name=user-queue to the two jobs and set suspend to true to let Kueue manage jobs.
View workload and job status.
The expected result is as follows:
- One job is admitted (ADMITTED of the corresponding workload is True), and after the job is resumed (suspend is set to false), all 3 pods simultaneously enter the Running state.
- The other job remains in the Suspended state, due to insufficient quota, and its corresponding workload is in the Pending state and does not schedule any pods.
The preceding results prove that when the queue quota cannot accommodate all jobs, Kueue admits each entire job as a whole. This prevents resource waste where half of a job occupies quota and the other half waits in queue and achieves the job-level All-or-Nothing capability.
After validation is complete, run the following commands to clean up the jobs, queues, and Kueue add-on created in this topic.