Bird
0
0

You want to limit a namespace to 5 pods and 2Gi memory requests, but allow unlimited CPU. Which ResourceQuota YAML snippet achieves this?

hard📝 Workflow Q15 of 15
Kubernetes - Namespaces
You want to limit a namespace to 5 pods and 2Gi memory requests, but allow unlimited CPU. Which ResourceQuota YAML snippet achieves this?
Aspec: hard: pods: "5" requests.memory: "2Gi" requests.cpu: "0"
Bspec: hard: pods: "5" requests.memory: "2Gi"
Cspec: hard: pods: "5" requests.memory: "2Gi" limits.cpu: "unlimited"
Dspec: hard: pods: "5" requests.memory: "2Gi" requests.cpu: "-1"
Step-by-Step Solution
Solution:
  1. Step 1: Understand ResourceQuota limits

    To limit pods and memory requests, specify those keys under hard. Omitting CPU means no limit on CPU.
  2. Step 2: Evaluate options for CPU limits

    spec: hard: pods: "5" requests.memory: "2Gi" omits CPU limits, allowing unlimited CPU. Options A, C, D try to set CPU limits with invalid or restrictive values.
  3. Final Answer:

    spec: hard: pods: "5" requests.memory: "2Gi" -> Option B
  4. Quick Check:

    Omit CPU limit to allow unlimited CPU [OK]
Quick Trick: Omit resource in quota to allow unlimited usage [OK]
Common Mistakes:
  • Setting CPU limit to 0 or negative disables pods
  • Using 'unlimited' as a value (not valid)
  • Trying to limit CPU when unlimited is desired

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes