This directory contains basic examples to get you started with KAI Scheduler.
A queue represents a job queue in the cluster. Queues are an essential scheduling primitive and can reflect different scheduling guarantees, such as resource quota and priority. Queues are typically assigned to different consumers in the cluster (users, groups, or initiatives). A workload must belong to a queue in order to be scheduled.
KAI Scheduler supports multi-level hierarchical scheduling queues.
After installing KAI Scheduler, a default queue hierarchy is automatically created:
default-parent-queue– Top-level (parent) queue. By default, this queue has no reserved resource quotas, allowing governance of resource distribution for its leaf queues.default-queue– Leaf (child) queue under thedefault-parent-queuetop-level queue. Workloads should reference this queue.
The default queues are defined in default-queues.yaml.
No manual queue setup is required. Both queues will exist immediately after installation, allowing you to start submitting workloads right away.
To add custom queues, apply your queue configuration:
kubectl apply -f queues.yamlFor detailed configuration options, refer to the Scheduling Queues documentation.
To schedule a pod using KAI Scheduler, ensure the following:
- Specify the queue name using the
kai.scheduler/queue: default-queuelabel on the pod/workload. - Set the scheduler name in the pod specification as
kai-scheduler.
This ensures the pod is placed in the correct scheduling queue and managed by KAI Scheduler.
⚠️ Workload NamespacesWhen submitting workloads, make sure to use a dedicated namespace. Do not use the
kai-schedulernamespace for workload submission.
To submit a simple pod that requests CPU and memory resources:
kubectl apply -f pods/cpu-only-pod.yamlBefore running GPU workloads, ensure the NVIDIA GPU-Operator is installed in the cluster.
To submit a pod that requests a GPU resource:
kubectl apply -f pods/gpu-pod.yaml| File | Description |
|---|---|
| default-queues.yaml | Default parent and leaf queue configuration |
| pods/cpu-only-pod.yaml | Example CPU-only pod |
| pods/gpu-pod.yaml | Example GPU pod |