Courseiva
Container Orchestration →mediumMultiple Select

KCNA Container Orchestration Practice Question

Which TWO of the following are required fields when defining a container in a Kubernetes Pod spec? (Choose 2)

⚠ Common exam trap

CNCF often tests the misconception that `ports` or `resources` are required because they appear in most example Pod specs, but the KCNA exam expects you to know that only `name` and `image` are mandatory per the Kubernetes API specification.

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

✓

image

In a Kubernetes Pod spec, the `name` and `image` fields are mandatory for each container definition. The `name` field uniquely identifies the container within the Pod, and the `image` field specifies the container image to run (e.g., `nginx:1.25`). Without these two fields, the Pod creation will fail with a validation error from the Kubernetes API server.

Answer analysis

Option-by-option breakdown

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

  • ✗

    env

    Why it's wrong here

    The env field is optional; environment variables may be supplied at runtime or omitted entirely, so a container spec validates without it. It tempts because most real containers do set environment variables, but the only required container field is name (plus image).

  • ✓

    image

    Why this is correct

    The `image` field is mandatory because the kubelet needs a container image reference to pull and instantiate the container's filesystem and process. Without it, the Pod spec fails validation, satisfying the stem's requirement for a required field alongside `name`.

  • ✓

    name

    Why this is correct

    Every container in a Pod spec requires a name, which uniquely identifies it within that Pod so kubectl logs, exec and status commands can target the correct container. Omitting it causes API server validation to reject the manifest.

  • ✗

    resources

    Why it's wrong here

    The Pod spec's required fields are only containers[].name and containers[].image; resources is optional, defaulting to unlimited if omitted. It is tempting because resource requests and limits are best practise for scheduling and stability, and would be the right answer to a question about production readiness or quality of service.

  • ✗

    ports

    Why it's wrong here

    The ports field is optional; omitting it leaves the container's listening ports unspecified, which is valid for Pods that need no declared ports. It tempts because exposing ports feels essential, yet Kubernetes requires only name and image in a container definition.

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