DevOps · Flashcard

In node affinity, multiple nodeSelectorTerms are ORed. Multiple matchExpressions within one term are ANDed. What does this mean in practice?

  • AA Pod schedules if ANY term matches, but within one term ALL expressions must match simultaneously
  • BEvery term and every expression across all terms must match for the Pod to schedule on a node
  • CTerms are evaluated in order and the first matching term wins, causing later terms to be skipped
  • DExpressions within a term are ORed and the terms themselves are ANDed for stricter filtering

Why this is the answer

nodeSelectorTerms is an OR list — matching any one term is enough. But matchExpressions within a single term is an AND list — all expressions must match. This is a frequent source of misconfiguration: adding a second term when you meant to add a second expression within the first.

Official docs
Study in Gnoseed →