Courseiva
Kubernetes FundamentalshardMultiple ChoiceObjective-mapped

KCNA Kubernetes Fundamentals Practice Question

Which of the following is a correct way to assign a pod to a specific node using a nodeSelector?

⚠ Common exam trap

It's easy for candidates to confuse the YAML syntax for `nodeSelector` (a map) with that of `nodeAffinity` or `nodeName`, or incorrectly use an array format like `[disktype: ssd]` instead of the correct key-value pair.

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

spec: nodeSelector: disktype: ssd

`nodeSelector` is a simple pod scheduling constraint that uses a key-value pair in the `spec.nodeSelector` field to match node labels. The correct YAML syntax is `spec: nodeSelector: disktype: ssd`, where `disktype` is the label key and `ssd` is the value, ensuring the pod is scheduled only on nodes with that exact label.

Answer analysis

Option-by-option breakdown

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

  • spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: ...

    Why it's wrong here

    This is node affinity, which is more expressive but not the simple nodeSelector.

  • spec: nodeName: "node1"

    Why it's wrong here

    nodeName directly assigns a node, but it's not a nodeSelector.

  • spec: nodeSelector: [disktype: ssd]

    Why it's wrong here

    nodeSelector expects a map, not an array.

  • spec: nodeSelector: disktype: ssd

    Why this is correct

    This is the correct syntax for nodeSelector.

About these practice questions

Courseiva writes every KCNA question from scratch — 833 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.