Member-only story
DevOps in K8s — PriorityClass
Note, full “DevOps in K8s” mind map is available at: “DevOps in K8s Mind Map”
What is PriorityClass
In K8s, PriorityClass
is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. It allows you to establish a priority for the pods, ensuring that more important pods are scheduled ahead of others, or even that they get the necessary resources during times of resource scarcity.
An example of PriorityClass
definition looks like:
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 100000
globalDefault: false
description: "Should be used for critical service pods only."
name
: Name of thePriorityClass
.value
: An integer that defines the rank/importance of this class.globalDefault
: If set totrue
, all pods without an explicitpriorityClassName
will use this class. Only onePriorityClass
should be marked asglobalDefault
.description
: An arbitrary string that describes what thePriorityClass
is used for.