A workload is an application that will run to completion. It can be composed by one or multiple Pods that, loosely or tightly coupled, that, as a whole, complete a task. A workload is the unit of admission in Kueue.
The prototypical workload can be represented with a
For this reason, we sometimes use the word job to refer to any workload, and
Job when we refer specifically to the Kubernetes API.
However, Kueue does not directly manipulate Job objects. Instead, Kueue manages Workload objects that represent the resource requirements of an arbitrary workload. Kueue automatically creates a Workload for each Job object and syncs the decisions and statuses.
The manifest for a Workload looks like the following:
apiVersion: kueue.x-k8s.io/v1beta1 kind: Workload metadata: name: sample-job namespace: team-a spec: queueName: team-a-queue podSets: - count: 3 name: main spec: containers: - image: gcr.io/k8s-staging-perf-tests/sleep:latest imagePullPolicy: Always name: container resources: requests: cpu: "1" memory: 200Mi restartPolicy: Never
To indicate in which LocalQueue you want your Workload to be
enqueued, set the name of the LocalQueue in the
A Workload might be composed of multiple Pods with different pod specs.
Each item of the
.spec.pods list represents a set of homogeneous Pods and has
the following fields:
specdescribes the pods using a
countis the number of pods that use the same
nameis a human-readable identifier for the pod set. You can use the role of the Pods in the Workload, like
Workloads have a priority that influences the order in which they are admitted by a ClusterQueue.
You can see the priority of the Workload in the field
batch/v1.Job, Kueue sets the priority of the Workload based on the
of the Job’s pod template.
As described previously, Kueue has built-in support for workloads created with the Job API. But any custom workload API can integrate with Kueue by creating a corresponding Workload object for it.
- Learn how to run jobs
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.