kubernetes scheduling_error ai_generated true

Error creating: pods is forbidden: no PriorityClass with name found

ID: kubernetes/k8s-priority-class-not-found

Also available as: JSON · Markdown
92%Fix Rate
90%Confidence
45Evidence
2023-06-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
8 active

Root Cause

Pod references a PriorityClass that doesn't exist in the cluster. The PriorityClass must be created before pods can use it.

generic

Workarounds

  1. 95% success Create the missing PriorityClass resource
    kubectl apply -f - <<EOF
    apiVersion: scheduling.k8s.io/v1
    kind: PriorityClass
    metadata:
      name: <name>
    value: 1000000
    globalDefault: false
    EOF

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

  2. 88% success List existing PriorityClasses and use one that already exists
    kubectl get priorityclasses to see available classes

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

Dead Ends

Common approaches that don't work:

  1. Remove priorityClassName from the pod spec 55% fail

    Pod loses scheduling priority — may be preempted by other workloads

  2. Use a numeric priority value directly 90% fail

    Kubernetes requires a PriorityClass resource — numeric priority is set on the PriorityClass, not the pod

Error Chain

Leads to:
Preceded by:
Frequently confused with: