Skip to main content
Version: Next

Labels and Annotations in YuniKorn

Labels and Annotations in YuniKorn

YuniKorn utilizes several Kubernetes labels and annotations to support various features.

Since YuniKorn 1.6.0, we have provided canonical representations for defining application ID and queue in labels under the namespace yunikorn.apache.org. Using these labels can benefit from the Kubernetes filtering and grouping capabilities. The non-canonical (legacy) representations will not be deprecated and will continue to be supported in future releases.

Labels in YuniKorn

Label values should comply with Kubernetes Syntax and character set.

NameDescription
yunikorn.apache.org/app-idAssociates this pod with an application. This is the canonical representation and it is recommended to use it.

The priority of application ID is determined in the following order:
  1. Label yunikorn.apache.org/app-id
  2. Annotation yunikorn.apache.org/app-id
  3. Label applicationId
  4. Label spark-app-selector
Note: Pods with inconsistent application metadata will be rejected in 1.7.0.
yunikorn.apache.org/queueSelects the YuniKorn queue this application should be scheduled in. This is the canonical representation and it is recommended to use it.

Queue name should comply with Kubernetes Syntax and character set and also with Partition and Queue Configuration. This may be ignored if a placement policy is in effect.

The priority of queue name is determined in the following order:
  1. Label yunikorn.apache.org/queue
  2. Annotation yunikorn.apache.org/queue
  3. Label queue
Note: Pods with inconsistent queue metadata will be rejected in 1.7.0.
[LEGACY]
applicationId
Equivalent to the preferred label yunikorn.apache.org/app-id.
[LEGACY]
queue
Equivalent to the preferred label yunikorn.apache.org/queue.
spark-app-selectorEquivalent to the preferred label yunikorn.apache.org/app-id.

It is automatically attached by third-party Spark jobs triggered by the Spark Operator. YuniKorn uses this label to define application ID if no other metadata exists.

Annotations in YuniKorn

NameDescription
[LEGACY]
yunikorn.apache.org/app-id
Equivalent to the preferred label yunikorn.apache.org/app-id.
[LEGACY]
yunikorn.apache.org/queue
Equivalent to the preferred label yunikorn.apache.org/queue.
yunikorn.apache.org/task-group-nameSets the task group name this pod belongs to for the purposes of gang scheduling. It must be listed within yunikorn.apache.org/task-groups.
yunikorn.apache.org/task-groupsDefines the set of task groups for this application for gang scheduling. Each pod within an application must define all task groups.
yunikorn.apache.org/schedulingPolicyParametersArbitrary key-value pairs used to customize scheduling policies such as gang scheduling.
yunikorn.apache.org/allow-preemptionThis annotation can be set on the Pod or PriorityClass object. The annotation in Pod takes priority over PriorityClass. It will trigger opt out of preemption for pods. Further details can be found in the DaemonSet Scheduling using Simple Preemptor documentation.
yunikorn.apache.org/parentqueueDefine a parent queue for a set of K8s namespaces. Further details can be found in the Resource Quota Management documentation.
yunikorn.apache.org/namespace.quotaSet the maximum capacity of the queue mapped to this namespace. Further details can be found in the Resource Quota Management documentation.
[DEPRECATED]
yunikorn.apache.org/namespace.max.cpu
Replaced with yunikorn.apache.org/namespace.quota since version 1.2.0
[DEPRECATED]
yunikorn.apache.org/namespace.max.memory
Replaced with yunikorn.apache.org/namespace.quota since version 1.2.0
yunikorn.apache.org/namespace.enableYuniKornControls which namespaces will have pods forwarded to Yunikorn for scheduling. Further details can be found in the Service Configuration #admission-controller-filtering-settingsdocumentation.
yunikorn.apache.org/namespace.generateAppIdControls which namespaces will have pods labeled with an yunikorn.apache.org/app-id. Further details can be found in the Service Configuration #admission-controller-filtering-settings documentation.

For more details surrounding gang-scheduling labels and annotations, please refer to the documentation on gang scheduling.