OCP Pod scheduling - Explanation of Toleration , Taints , nodeSelector , Affinity - Pod status reports: didn't match Pod's node affinity/selector

Solution Verified - Updated -

Issue

The purpose of this document is to clarify and summarize in a few lines the concept and purpose of :

  • tolerations
  • taints
  • nodeSelector
  • affinity

If these are incorrectly configured, we may end up having pods in Pending status, failing to be started with errors like

status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: '2022-10-05T12:01:38Z'
    message: '0/29 nodes are available: 23 node(s) didn''t match Pod''s node affinity/selector,
      3 node(s) had taint {node-role.kubernetes.io/infra: }, that the pod didn''t
      tolerate, 3 node(s) had taint {node-role.kubernetes.io/master: }, that the pod
      didn''t tolerate.'
    reason: Unschedulable
    status: 'False'
    type: PodScheduled
  phase: Pending

Environment

  • OCP 4.x
  • OCS / ODF 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content