📚 Resources Requests & Limits သဘောတရား

August 5, 2026

🎯 ဘာလို အရေးကြီးလဲ? Production မှာ resources မသတ်မှတ်ရင်:

resources:
  requests:    # "ငါ့ကို အနည်းဆုံး ဒီလောက် ပေးပါ"
    cpu: "500m"      # 0.5 CPU core
    memory: "512Mi"  # 512 MiB RAM
  limits:      # "ငါ အများဆုံး ဒီလောက်ပဲ သုံးမယ်"
    cpu: "1000m"     # 1 CPU core
    memory: "1Gi"    # 1 GiB RAM

ConceptPurposeWhat happens?
RequestsScheduling အတွက်Scheduler က requests အပေါ် မူတည်ပြီး node ရွေးတယ်
LimitsRuntime protectionPod က limits ထက် ပိုသုံးရင် throttle/kill လုပ်တယ်
📊 CPU vs Memory Behavior CPU (Compressible Resource): - Limit ကျော်ရင် → Throttle (နည်းသွားတယ်၊ မသေဘူး)
• Pod က ဆက် run နေတယ်၊ CPU ပဲ လျှော့ပေးတယ်
Memory (Non-Compressible Resource): - Limit ကျော်ရင် → OOMKilled (Out of Memory - သေသွားတယ်!)
• Pod က restart ဖြစ်တယ် 📖 Part 2: QoS Classes (Quality of Service) Kubernetes က pod ရဲ့ resources config ကို ကြည့်ပြီး QoS class သတ်မှတ်တယ်။ 🏆 QoS Classes (3 မျိုး)
ClassConditionEviction Priority
Guaranteedrequests = limits (all containers)နောက်ဆုံး evict (အရေးကြီးဆုံး)
Burstablerequests \< limits (or only requests)အလယ် evict
BestEffortNo requests/limitsပထမဆုံး evict (အရေးမကြီး)
Pod QoS ဆိုတာ "အညံ့ဆုံး" container အပေါ် မမူတည်ဘူး။
Pod QoS ဆိုတာ 3 ခု rule ကို စစ်တယ်: 1. Guaranteed rule satisfy လား? → No → ဆက်စစ် 2. BestEffort rule satisfy လား? → No → ဆက်စစ် 3. Default → Burstable ✅ ဥပမာ ```javascript 🧪 Your Scenario Analysis

Pod: my-pod (5 containers)

Container 1: Guaranteed (requests = limits) Container 2: Guaranteed (requests = limits) Container 3: Guaranteed (requests = limits) Container 4: Guaranteed (requests = limits) Container 5: BestEffort (no resources)

	```
</column>
<column ratio="50">
	Step 1: Check Guaranteed?<br>→ ALL containers have requests=limits? ❌ (Container 5 မရှိဘူး)<br>→ NOT Guaranteed
	Step 2: Check BestEffort?<br>→ ALL containers have NO resources? ❌ (Container 1-4 ရှိတယ်)<br>→ NOT BestEffort
	Step 3: Default to Burstable<br>→ Pod QoS = Burstable ✅
</column>
QoS Decision (Pod Level)
ScenarioPod QoS
All containers: requests=limitsGuaranteed
All containers: no resourcesBestEffort
Mix (some resources, not all requests=limits)Burstable
4 Guaranteed + 1 BestEffortBurstable ❌ NOT BestEffort
4 Guaranteed + 1 BurstableBurstable
Eviction Behavior
QuestionAnswer
Evict pod သိုမဟုတ် container?Pod တစ်ခုလုံး ✅
Container တစ်ခုပဲ evict လိုရလား?မရဘူး ❌
Pod evict ရင် containers အားလုံး die လား?ဟုတ်တယ် ✅