nerdexam
Linux_Foundation

KCNA · Question #65

What does the "nodeSelector" within a PodSpec use to place Pods on the target nodes?

The correct answer is D. Labels. The nodeSelector field in a PodSpec uses node labels to constrain which nodes a Pod is eligible to be scheduled on.

Submitted by khalil_dz· May 4, 2026Kubernetes Fundamentals

Question

What does the "nodeSelector" within a PodSpec use to place Pods on the target nodes?

Options

  • AAnnotations
  • BIP Addresses
  • CHostnames
  • DLabels

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    3% (1)
  • D
    93% (27)

Why each option

The `nodeSelector` field in a PodSpec uses node labels to constrain which nodes a Pod is eligible to be scheduled on.

AAnnotations

Annotations are used for non-identifying metadata and do not influence Pod scheduling decisions like `nodeSelector` does.

BIP Addresses

While nodes have IP addresses, `nodeSelector` does not directly use IP addresses for scheduling; it relies on labels for declarative node selection.

CHostnames

Hostnames are identifiers for nodes, but `nodeSelector` operates on arbitrary key-value labels, offering more flexible and generic selection than just hostnames.

DLabelsCorrect

The `nodeSelector` field in a PodSpec takes a map of key-value pairs, which are then matched against the labels assigned to nodes. Only nodes that possess all the specified labels will be considered for scheduling the Pod.

Concept tested: Kubernetes Pod scheduling with nodeSelector

Source: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector

Topics

#Kubernetes Scheduling#nodeSelector#Node Labels#Pod Placement

Community Discussion

No community discussion yet for this question.

Full KCNA Practice