1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/kueue-configuring-labelpolicy.adoc
2025-10-01 17:34:03 +00:00

46 lines
1.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * ai_workloads/kueue/managing-workloads.adoc
:_mod-docs-content-type: REFERENCE
[id="configuring-labelpolicy_{context}"]
= Configuring label policies for jobs
The `spec.config.workloadManagement.labelPolicy` spec in the `Kueue` custom resource (CR) is an optional field that controls how {kueue-name} decides whether to manage or ignore different jobs. The allowed values are `QueueName`, `None` and empty (`""`).
If the `labelPolicy` setting is omitted or empty (`""`), the default policy is that {kueue-name} manages jobs that have a `kueue.x-k8s.io/queue-name` label, and ignores jobs that do not have the `kueue.x-k8s.io/queue-name` label. This is the same workflow as if the `labelPolicy` is set to `QueueName`.
If the `labelPolicy` setting is set to `None`, jobs are managed by {kueue-name} even if they do not have the `kueue.x-k8s.io/queue-name` label.
.Example `workloadManagement` spec configuration
[source,yaml]
----
apiVersion: kueue.openshift.io/v1
kind: Kueue
metadata:
labels:
app.kubernetes.io/name: kueue-operator
app.kubernetes.io/managed-by: kustomize
name: cluster
namespace: openshift-kueue-operator
spec:
config:
workloadManagement:
labelPolicy: QueueName
# ...
----
.Example user-created `Job` object containing the `kueue.x-k8s.io/queue-name` label
[source,yaml]
----
apiVersion: batch/v1
kind: Job
metadata:
generateName: sample-job-
namespace: my-namespace
labels:
kueue.x-k8s.io/queue-name: user-queue
spec:
# ...
----