Priority Class
Planted .
It is a cluster-wide object part of scheduling.k8s.io/v1. It has a mapping of priority class name and an integer value. Higher value has higher priority.
Kubernetes ships with a few default ones, examples below:
kubectl get priorityClass
NAME VALUE GLOBAL-DEFAULT AGE PREEMPTIONPOLICY
system-cluster-critical 2000000000 false 28m PreemptLowerPriority
system-node-critical 2000001000 false 28m PreemptLowerPriority
Example
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
globalDefault: false
description: "This priority class should be used for XYZ service pods only." Paths into this note
2 notes lead here
-
By default in PriorityClass, the preemptionPolicy is set to PreemptLowerPriority, but it can be set to Never in which case these higher priority pods will not preempt other pods. Which might be useful in scenarios where you have a higher priority task but you don't want to kill existing tasks.
-
Set up a PriorityClass