Courseiva
Kubernetes FundamentalsmediumMultiple ChoiceObjective-mapped

KCNA Kubernetes Fundamentals Practice Question

A pod is experiencing high memory usage. The administrator wants to enforce that the pod is terminated if it exceeds a memory limit and restarted automatically, but also wants to guarantee a minimum amount of memory for the pod. Which resource specification should be used in the container definition?

⚠ Common exam trap

CNCF often tests the misconception that setting only `limits.memory` is sufficient for both guarantee and enforcement, but without `requests.memory` the pod has no guaranteed minimum and may be evicted under node pressure, failing the 'guarantee a minimum' requirement.

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.containers[].resources.requests.memory and limits.memory

Setting both `requests.memory` and `limits.memory` guarantees a minimum memory allocation (the request) while enforcing a hard cap (the limit). If the pod exceeds the memory limit, it is terminated (OOMKilled) and, if part of a Deployment or StatefulSet, the controller automatically restarts it. This satisfies the requirement for both guaranteed minimum and enforced maximum with automatic restart.

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.containers[].resources.requests.memory only

    Why it's wrong here

    Requests guarantee a minimum but do not cap; the pod could use more and affect others.

  • spec.containers[].resources.limits.memory and requests.cpu

    Why it's wrong here

    requests.cpu is for CPU, not memory; this does not address memory requirements.

  • spec.containers[].resources.limits.memory only

    Why it's wrong here

    Limits alone cap usage but do not guarantee a minimum; the pod could be starved if nodes are under pressure.

  • spec.containers[].resources.requests.memory and limits.memory

    Why this is correct

    Requests guarantee the minimum; limits cap the maximum. If memory exceeds limits, the pod is OOMKilled and restarted.

About these practice questions

One of 833 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

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.