Setup default WorkloadPriorityClass

Setup a default WorkloadPriorityClass to assign a queueing priority to jobs that don’t specify one.
Feature state beta since Kueue v0.20

This page describes how to setup a default WorkloadPriorityClass to ensure that all Kueue-managed workloads receive a consistent queueing priority, even if the kueue.x-k8s.io/priority-class label is not specified explicitly.

Setup default WorkloadPriorityClass

WorkloadPriorityClassDefaulting is a feature that allows the use of a WorkloadPriorityClass with name default as the default WorkloadPriorityClass for workloads that do not have the kueue.x-k8s.io/priority-class label.

To use this feature:

  • the WorkloadPriorityClassDefaulting feature gate is enabled by default since v0.20 (Beta). On earlier versions, or if it was explicitly disabled, enable it in the Kueue configuration. Check the Installation guide for details on feature gate configuration.

  • create a WorkloadPriorityClass with the name default:

apiVersion: kueue.x-k8s.io/v1beta2
kind: WorkloadPriorityClass
metadata:
  name: default
value: 1000
description: "Default workload priority"

That’s all! Now, to test the feature, create a Job without the kueue.x-k8s.io/priority-class label. Observe that the Job is updated with the kueue.x-k8s.io/priority-class: default label.

Note that jobs that already have the kueue.x-k8s.io/priority-class label won’t be modified.