KCNA - Kubernetes Fundamentals - Section 1.5

Explain how the scheduler places Pods and which mechanisms influence that placement.

Resource requests and limits, node selectors, affinity and anti-affinity, taints and tolerations, and the filtering-then-scoring model the scheduler applies. Candidates should be able to predict whether a Pod schedules given a described cluster state.

resource requests and limitsnodeSelectornode and pod affinitytaints and tolerationsscheduler filtering and scoring

Practice question for this objective

Free sampleKubernetes Fundamentalsmedium

A team wants two Pods of the same latency-sensitive application to be scheduled onto the same node so they share a low-latency link, and they want this decided relative to where other Pods of that application already run. Which placement mechanism expresses a rule based on the location of other Pods rather than on node attributes?

  • AnodeSelector, which matches Pods to nodes by comparing required labels against the labels present on each node.
  • BNode affinity, which constrains a Pod to nodes whose labels satisfy expressions such as a required zone or disk type.
  • CPod affinity, which schedules a Pod relative to nodes already running other Pods that match a label selector, using a topology key. Correct
  • DResource requests, which reserve CPU and memory so co-located Pods do not starve each other on a shared node.
Pod affinity places a Pod relative to other Pods' locations, whereas node affinity and nodeSelector match node attributes. Pod affinity and anti-affinity evaluate a label selector against Pods that are already scheduled, combined with a topology key that defines the co-location boundary such as a node or a zone. Node affinity and nodeSelector, by contrast, only inspect labels on the nodes themselves and are blind to other Pods.

Why A is wrong: nodeSelector is tempting because it also controls placement, but it matches on node labels alone and has no notion of where other Pods are running.

Why B is wrong: Node affinity is a richer version of nodeSelector, yet it still evaluates node labels rather than the presence of other Pods, so it cannot co-locate Pods relative to each other.

Why C is correct: Correct: pod affinity evaluates the labels of Pods already placed and a topology key, so it can draw a new Pod onto the same node or zone as matching Pods.

Why D is wrong: Requests influence which nodes have room, which sounds related to co-location, but they express capacity needs and never reference other Pods' locations.

See more KCNA practice questions, answers explained.

More in this domain

Back to all Kubernetes Fundamentals objectives, or the KCNA cert hub.

Examworthy is not affiliated with or endorsed by Cloud Native Computing Foundation. Original, blueprint-aligned practice material only.