Courseiva
Kubernetes Fundamentals →hardMultiple Select

KCNA Kubernetes Fundamentals Practice Question

Which THREE of the following are valid fields in a Kubernetes Deployment spec (apps/v1)?

⚠ Common exam trap

CNCF often tests the distinction between fields that belong to the Deployment spec versus fields that belong to the Pod spec, so candidates mistakenly select `containers` or `nodeName` as top-level Deployment fields.

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

✓

replicas

In an apps/v1 Deployment spec, the correct top-level fields include A. replicas, which declares the desired number of Pod replicas the ReplicaSet managed by the Deployment should maintain; B. template, which is the required PodTemplateSpec describing the Pods to be created; and C. selector, which is the required LabelSelector that must match the labels in the template and determines which Pods the Deployment manages. Options D and E are not valid Deployment spec fields: containers belongs inside the Pod template's spec (spec.template.spec.containers), not directly under the Deployment spec, and nodeName is a Pod-level scheduling field under spec.template.spec, not a Deployment spec field.

Answer analysis

Option-by-option breakdown

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

  • ✓

    replicas

    Why this is correct

    `replicas` sits under `spec` and declares the desired number of Pod replicas the ReplicaSet should maintain, satisfying the question's requirement for a genuine apps/v1 Deployment field. It is a core scaling parameter, distinct from metadata or status, and is reconciled continuously by the Deployment controller to match observed state.

  • ✓

    template

    Why this is correct

    The `template` field nests a PodTemplateSpec, defining the pod blueprint each ReplicaSet instantiates, including containers, volumes and labels. It sits directly under `spec`, satisfying the requirement for a valid apps/v1 Deployment field, and its labels must match the selector or the Deployment is rejected.

  • ✓

    selector

    Why this is correct

    The `selector` field is mandatory in an apps/v1 Deployment, matching pods via label queries so the ReplicaSet can adopt and manage them. It satisfies the stem's requirement for a valid Deployment spec field, since `spec.selector` must be defined and its labels must match `spec.template.metadata.labels`.

  • ✗

    containers

    Why it's wrong here

    containers sits inside the Pod template's spec, not at the Deployment spec's top level, so listing it as a Deployment field is incorrect. It is tempting because containers is a genuine Kubernetes field, and it would be correct when describing a Pod or the template within a Deployment.

  • ✗

    nodeName

    Why it's wrong here

    nodeName belongs to a Pod spec, not a Deployment spec; Deployments select Pods via template and scheduler placement rather than pinning a node directly. It is tempting because nodeName is valid YAML in Pod manifests, so it would be the correct field when defining a standalone Pod.

About these practice questions

One of 930 original KCNA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on KCNA

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which field in a Deployment YAML specifies the number of pod replicas?

medium
  • ✓ A.spec.replicas
  • B.spec.template.spec.replicas
  • C.spec.replicaCount
  • D.spec.selector.matchLabels

Why A: In a Kubernetes Deployment YAML, the `spec.replicas` field directly defines the desired number of pod replicas that the Deployment controller should maintain. This is a top-level field under the Deployment spec, not nested under `template.spec`, because the replica count is a property of the Deployment itself, not of the Pod template.

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.