Bird
0
0

Which of the following is the correct syntax to set a memory request of 256Mi and limit of 512Mi in a container spec?

easy📝 Configuration Q3 of 15
Kubernetes - Resource Management
Which of the following is the correct syntax to set a memory request of 256Mi and limit of 512Mi in a container spec?
Aresources:\n limits:\n memory: \"256Mi\"\n requests:\n memory: \"512Mi\"
Bresources:\n requests:\n memory: \"256Mi\"\n limits:\n memory: \"512Mi\"
Cresources:\n requests:\n cpu: \"256Mi\"\n limits:\n cpu: \"512Mi\"
Dresources:\n requests:\n memory: 256\n limits:\n memory: 512"
Step-by-Step Solution
Solution:
  1. Step 1: Check correct keys and values

    Memory requests and limits must be under resources with keys requests and limits, values as strings with units.
  2. Step 2: Validate units and order

    resources:\n requests:\n memory: \"256Mi\"\n limits:\n memory: \"512Mi\" correctly uses memory: "256Mi" for requests and memory: "512Mi" for limits.
  3. Final Answer:

    Correct YAML syntax with memory requests and limits as strings with units. -> Option B
  4. Quick Check:

    Memory requests and limits need units and correct nesting [OK]
Quick Trick: Memory values need units like Mi or Gi as strings [OK]
Common Mistakes:
  • Swapping requests and limits
  • Using CPU keys instead of memory
  • Omitting units or quotes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes