Bird
0
0

You want to ensure a container always gets at least 250m CPU but never uses more than 750m CPU. Which YAML snippet correctly sets this with CPU requests and limits?

hard📝 Best Practice Q15 of 15
Kubernetes - Resource Management
You want to ensure a container always gets at least 250m CPU but never uses more than 750m CPU. Which YAML snippet correctly sets this with CPU requests and limits?
Aresources: requests: cpu: "250m" limits: cpu: "750m"
Bresources: requests: cpu: "750m" limits: cpu: "250m"
Cresources: requests: cpu: 0.25 limits: cpu: 0.75
Dresources: requests: cpu: "0.75" limits: cpu: "0.25"
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct CPU units and values

    CPU values can be specified as millicores with 'm' suffix, e.g., "250m" for 0.25 CPU.
  2. Step 2: Check request and limit order

    Request must be less than or equal to limit. resources: requests: cpu: "250m" limits: cpu: "750m" sets request to 250m and limit to 750m correctly.
  3. Final Answer:

    resources: requests: cpu: "250m" limits: cpu: "750m" -> Option A
  4. Quick Check:

    Request 250m ≤ Limit 750m with correct units = resources: requests: cpu: "250m" limits: cpu: "750m" [OK]
Quick Trick: Use millicores with 'm' and keep request ≤ limit [OK]
Common Mistakes:
  • Swapping request and limit values
  • Using decimal numbers without quotes
  • Not using millicores for fractional CPU

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes