Courseiva
Kubernetes FundamentalshardMultiple ChoiceObjective-mapped

KCNA Kubernetes Fundamentals Practice Question

You want to create a new Namespace called 'staging' and apply a ResourceQuota to it. Which of the following YAML snippets correctly defines a ResourceQuota that limits total memory to 10Gi and total CPU to 5 cores in namespace 'staging'?

⚠ Common exam trap

The exam often tests the distinction between ResourceQuota (namespace-wide aggregate limits) and LimitRange (per-container defaults), and the requirement to specify `limits.cpu`/`limits.memory` (not just `cpu`/`memory`) in the ResourceQuota spec to target the actual resource limits.

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

apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: staging-quota\n namespace: staging\nspec:\n hard:\n limits.cpu: "5"\n limits.memory: 10Gi

It defines a ResourceQuota with `limits.cpu` and `limits.memory` under `spec.hard`, which restricts the total CPU and memory that all pods in the namespace can consume. The values are specified as strings ("5" for CPU and 10Gi for memory), which is the correct format for ResourceQuota resources in Kubernetes.

Answer analysis

Option-by-option breakdown

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

  • apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: staging-quota\n namespace: staging\nspec:\n hard:\n requests.cpu: "5"\n requests.memory: 10Gi

    Why it's wrong here

    This limits requests, not limits. The question asks to limit total memory and CPU, which typically refers to limits.

  • apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: staging-quota\n namespace: staging\nspec:\n hard:\n limits.cpu: "5"\n limits.memory: 10Gi

    Why this is correct

    Correct syntax for ResourceQuota.

  • apiVersion: v1\nkind: LimitRange\nmetadata:\n name: staging-limits\n namespace: staging\nspec:\n limits:\n - default:\n cpu: 5\n memory: 10Gi\n defaultRequest:\n cpu: 1\n memory: 1Gi

    Why it's wrong here

    LimitRange sets per-container limits, not aggregate quotas.

  • apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: staging-quota\nspec:\n hard:\n cpu: 5\n memory: 10Gi

    Why it's wrong here

    Missing namespace field; 'cpu' and 'memory' are not valid resource names for quotas (use 'limits.cpu' and 'limits.memory').

About these practice questions

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