Skip to main content

Prioritize your workloads with priorityClassName

Context

Pods can have priority. Priority indicates the importance of a Pod relative to other Pods. If a Pod cannot be scheduled, the scheduler tries to preempt (evict) lower priority Pods to make scheduling of the pending Pod possible.

Use case

  • Make critical workloads more robust
  • Improve your SLA when having some very limited resources constraints (memory, cpu)

Technical Description

On a customer namespace, you should have the following priority class that you can use:

NameValue
customer-high-priority1000

HOWTO

Use a Priority Class for a pod ?

When deploying a pod, you should add the priorityClassName parameter link described in the following example:

apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
priorityClassName: high-priority

source: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/