Overview

September 30, 2024 ยท View on GitHub

This folder holds the preemption toleration plugin implemented as discussed in Preemption Toleration.

Maturity Level

  • ๐Ÿ’ก Sample (for demonstrating and inspiring purpose)
  • ๐Ÿ‘ถ Alpha (used in companies for pilot projects)
  • ๐Ÿ‘ฆ Beta (used in companies and developed actively)
  • ๐Ÿ‘จ Stable (used in companies for production workloads)

Example scheduler config:

apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
leaderElection:
  leaderElect: false
clientConnection:
  kubeconfig: "REPLACE_ME_WITH_KUBE_CONFIG_PATH"
profiles:
- schedulerName: default-scheduler
  plugins:
    postFilter:
      enabled:
      - name: PreemptionToleration
      disabled:
      - name: DefaultPreemption

How to define PreemptionToleration policy on PriorityClass resource

Preemption toleration policy can be defined on each PriorityClass resource by annotations like below:

# PriorityClass with PreemptionToleration policy:
# Any pod P in this priority class can not be preempted (can tolerate preemption)
# - by preemptor pods with priority < 10000 
# - and if P is within 1h since being scheduled
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: toleration-policy-sample
  annotations:
    preemption-toleration.scheduling.x-k8s.io/minimum-preemptable-priority: "10000"
    preemption-toleration.scheduling.x-k8s.io/toleration-seconds: "3600"
value: 8000