Courseiva

XK0-006 Automation, Orchestration, and Scripting Practice Question

A Kubernetes YAML manifest defines a Deployment. Which field specifies the number of pod replicas to run?

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 Deployment spec, the 'replicas' field sets the desired number of pod instances.

Answer analysis

Option-by-option breakdown

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

  • ✗

    metadata.replicas

    Why it's wrong here

    metadata holds identifying fields such as name, namespace and labels, not replica counts, so the API server rejects replicas there as an unknown field. Metadata is where you would legitimately set labels and annotations for selection and organisation, which makes it tempting when hunting for a field that controls pod behaviour.

  • ✗

    spec.template.replicas

    Why it's wrong here

    Placing replicas under spec.template nests it inside the pod template, where the API server rejects it as an unknown field; replica count belongs at spec.replicas, one level above the template. The template block is genuinely for pod-level settings such as container images and labels, so it is tempting when scanning for where pods are defined.

  • ✗

    spec.containers.replicas

    Why it's wrong here

    spec.containers is an array of container definitions inside the pod template, holding image, ports and resources; replicas is not a valid container key, so the manifest fails validation. Container-level fields are tempting because they configure the running workload, but replica count is a Deployment-level concern, set at spec.replicas.

  • ✓

    spec.replicas

    Why this is correct

    The replicas field sits under the Deployment's spec, declaring the desired pod count that the ReplicaSet controller continuously reconciles. Setting spec.replicas to the required number satisfies the stem's demand for specifying how many identical pods run concurrently.

About these practice questions

This XK0-006 question is part of Courseiva's 781-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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.