Courseiva
Kubernetes Fundamentals →mediumMultiple Choice

KCNA Kubernetes Fundamentals Practice Question

A cluster administrator wants to restrict which nodes a Pod can be scheduled on based on node labels, while also allowing the scheduler to prefer certain nodes but still run elsewhere if needed. Which combination of features should be used?

⚠ Common exam trap

The trap here is mixing up node affinity with pod affinity, or treating taints as a way to prefer nodes rather than to repel Pods.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use `nodeSelector` for a hard requirement and `nodeAffinity` with `preferredDuringSchedulingIgnoredDuringExecution` for soft preferences.

The scenario requires a hard constraint on node labels and a soft preference that still permits scheduling elsewhere. `nodeSelector` enforces the hard label match, while `nodeAffinity` with a preferred rule provides weighted preferences without preventing scheduling. Other mechanisms either constrain by Pod labels, repulse rather than prefer, or focus on spreading, so they do not satisfy both parts of the requirement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use `topologySpreadConstraints` with `whenUnsatisfiable: DoNotSchedule` to spread Pods across labeled nodes.

    Why it's wrong here

    `topologySpreadConstraints` balances Pod distribution across topology domains such as zones or nodes, using labels on nodes to define domains. It does not select specific nodes by label as a hard requirement, and `DoNotSchedule` makes the constraint mandatory rather than a preference. This option addresses spreading, not the combination of a hard node label requirement with a soft preference.

  • ✗

    Use `taints` on the nodes and `tolerations` on the Pod to define which nodes are preferred.

    Why it's wrong here

    Taints and tolerations control which Pods a node will accept, but they do not express preferences or scoring. A toleration allows a Pod onto a tainted node; it does not make that node preferred over another. To prefer nodes, affinity or node selectors are needed. This option confuses a repulsion mechanism with a preference mechanism and cannot achieve the stated soft preference.

  • ✓

    Use `nodeSelector` for a hard requirement and `nodeAffinity` with `preferredDuringSchedulingIgnoredDuringExecution` for soft preferences.

    Why this is correct

    `nodeSelector` provides a simple hard constraint that limits scheduling to nodes with matching labels. `nodeAffinity` with `preferredDuringSchedulingIgnoredDuringExecution` expresses soft preferences that influence scoring but do not block scheduling if no preferred node is available. Combining them gives a hard label requirement plus flexible preference, exactly matching the administrator's goal.

  • ✗

    Use `podAffinity` with `requiredDuringSchedulingIgnoredDuringExecution` to pin the Pod to nodes with specific labels.

    Why it's wrong here

    `podAffinity` constrains scheduling based on labels of other Pods, not node labels. Using it to select nodes by node labels is a category error. While required pod affinity can influence placement, it does not directly express a node label requirement and would not provide the soft preference described. This option misapplies the affinity type.

About these practice questions

This KCNA question is part of Courseiva's 930-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CNCF exam blueprint

This KCNA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the KCNA exam.