Courseiva
Kubernetes Fundamentals →hardMultiple Choice

KCNA Kubernetes Fundamentals Practice Question

In a YAML manifest for a Deployment, which field defines the number of pod replicas?

⚠ Common exam trap

It's easy for candidates to confuse the `spec.replicas` field with `spec.template` or `metadata`, or incorrectly assume that replica count is nested under `strategy` or `template`, leading them to pick A, B, or D.

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.replicas

In a Kubernetes Deployment manifest, the `spec.replicas` field is the correct place to define the desired number of pod replicas. This field is a top-level attribute under the Deployment's `spec` object, and the ReplicaSet controller uses this integer value to ensure the specified number of Pods are running at all times.

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.strategy.replicas

    Why it's wrong here

    The strategy block configures how rolling updates replace existing pods, defining maxSurge and maxUnavailable, not the desired pod count. It is tempting because it does govern pod lifecycle during a rollout, and it would be correct when specifying how many pods may be unavailable while an update proceeds.

  • ✗

    metadata.replicas

    Why it's wrong here

    The metadata block holds the Deployment's name, namespace and labels, which identify the object rather than control how many pods run. It is tempting because metadata appears in every manifest and is where naming and labelling are configured, and it would be correct for setting the Deployment's name or applying labels to it.

  • ✓

    spec.replicas

    Why this is correct

    Within a Deployment manifest, spec.replicas is the integer field declaring how many identical pod instances the ReplicaSet should maintain. It sits under spec alongside selector and template, directly answering the stem's request for the replica-count field.

  • ✗

    spec.template.replicas

    Why it's wrong here

    Replicas sit directly under spec, not beneath the pod template; spec.template describes the pod blueprint that the ReplicaSet controller copies, so no replicas key exists there. It is tempting because template is genuinely part of the Deployment schema, and it would be correct for defining the containers, image and labels of each pod.

About these practice questions

Courseiva writes every KCNA question from scratch — 930 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.